diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..88bed5d Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/README.md b/README.md index 4436ba9..a37f5f6 100644 --- a/README.md +++ b/README.md @@ -1 +1,54 @@ # harmony-sdk-examples + +# Install + +```bash +yarn install +``` + + +# Test local wallet + +1. open `nodejs` +2. run `node testWallet.js` +3. you can see `mnemonic` and `simple password` and 10 accounts imported + + +# Test with Harmony node + +First you have to run harmony's test node. + +1. git clone + + ``` bash + git clone git@github.com:harmony-one/harmony.git + ``` + +2. follow the `Build all executables` instruction, [here](https://github.com/harmony-one/harmony/tree/master) +3. open your editor, inside `core/resharding.go` , edit `GenesisShardSize = 50` to `GenesisShardSize = 5` +4. use this script to run + + ```bash + ./test/deploy.sh ./test/configs/ten-oneshard.txt + ``` + +Wait for the test-node running for 30 seconds, + +Then **open another console** , go back to our `nodejs` folder, + +Run: + +``` bash +node testNode.js +``` + + +# Test with `ganache-cli` +** ganache-cli runs in js file **, + +In this case, we use ganache and ethereum's setting to simulate the result + +We don't need harmony's testnode running. + +1. open `nodejs` +2. run `node testGanache.js` diff --git a/nodejs/contracts/Calc.sol b/nodejs/contracts/Calc.sol new file mode 100644 index 0000000..05fd01a --- /dev/null +++ b/nodejs/contracts/Calc.sol @@ -0,0 +1,19 @@ +pragma solidity ^0.5.1; + +contract Calc { + + uint count; + + function getCount() public returns (uint) { + + return count; + + } + + function add(uint a, uint b) public returns (uint) { + count++; + return a + b; + } + + +} \ No newline at end of file diff --git a/nodejs/contracts/MyContract.sol b/nodejs/contracts/MyContract.sol new file mode 100644 index 0000000..401e058 --- /dev/null +++ b/nodejs/contracts/MyContract.sol @@ -0,0 +1,8 @@ +pragma solidity ^0.5.1; + + +contract MyContract { + function myFunction() public returns(uint256 myNumber, string memory myString) { + return (23456, "Hello!%"); + } +} \ No newline at end of file diff --git a/nodejs/contracts/SimpleStorage.sol b/nodejs/contracts/SimpleStorage.sol new file mode 100644 index 0000000..564211b --- /dev/null +++ b/nodejs/contracts/SimpleStorage.sol @@ -0,0 +1,23 @@ +pragma solidity ^0.5.1; + +contract SimpleStorage { + + event ValueChanged(address indexed author, string oldValue, string newValue); + + string _value; + + constructor(string memory value) public { + emit ValueChanged(msg.sender, _value, value); + _value = value; + } + + function getValue() view public returns (string memory) { + return _value; + } + + function setValue(string memory value) public { + emit ValueChanged(msg.sender, _value, value); + _value = value; + } + +} \ No newline at end of file diff --git a/nodejs/index.js b/nodejs/index.js new file mode 100644 index 0000000..563681f --- /dev/null +++ b/nodejs/index.js @@ -0,0 +1,52 @@ +const { Harmony } = require('@harmony-js/core') +const { ChainID, ChainType } = require('@harmony-js/utils') + +const Settings = { + Ropsten: { + http: 'https://ropsten.infura.io/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + ws: 'wss://ropsten.infura.io/ws/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + type: ChainType.Ethereum, + id: ChainID.Ropsten + }, + Rinkeby: { + http: 'https://rinkeby.infura.io/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + ws: 'wss://rinkeby.infura.io/ws/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + type: ChainType.Ethereum, + id: ChainID.Ropsten + }, + Ganache: { + http: 'http://localhost:18545', + ws: 'ws://localhost:18545', + type: ChainType.Ethereum, + id: ChainID.Ganache + } +} + +// a function that will map the setting to harmony class constructor inputs +function useSetting(setting, providerType) { + return [setting[providerType], setting.type, setting.id] +} + +// simply change `Ropsten` to `Rinkeby` to test with different testnet +// and switch `ws` or `http` as RPC provider + +const harmony = new Harmony(...useSetting(Settings.Ropsten, 'ws')) + +// import our preset mnes +const mne = + 'food response winner warfare indicate visual hundred toilet jealous okay relief tornado' + +// now we have the mnes added to wallet +const acc1 = harmony.wallet.addByMnemonic(mne, 0) + +// now we create contract using extracted abi +// const myContract = harmony.contracts.createContract(abi) + +// first we get the account's balance to see if we have enough token on the testnet +acc1.getBalance().then(res => { + console.log(`-- hint: account balance of ${acc1.address}`) + console.log(``) + console.log({ account: res }) + console.log(``) + console.log(``) +}) diff --git a/nodejs/temp.html b/nodejs/temp.html new file mode 100644 index 0000000..4a9ce5d --- /dev/null +++ b/nodejs/temp.html @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + +
+ +
+ + + + + diff --git a/nodejs/testContract.js b/nodejs/testContract.js new file mode 100644 index 0000000..282c0f0 --- /dev/null +++ b/nodejs/testContract.js @@ -0,0 +1,222 @@ +// This example shows how you extract a contract's ABI +// And how to use `Contract.deploy().send()` to deploy the contract +// Then we can use `Contract.methods.call()` to call a method + +// Import Main Class +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') +const { SubscribeBlockTracker, RPCMethod } = require('@harmony-js/network') +// import more utils +const { isArray, ChainType, ChainID } = require('@harmony-js/utils') +// contract specific utils +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. +const fs = require('fs') +const solc = require('solc') + +// consturct the input function, here the solidity file lives in `./contracts/` +// we just type the file name as inpnut +function constructInput(file) { + const content = fs.readFileSync(`./contracts/${file}`, { encoding: 'utf8' }) + const input = { + language: 'Solidity', + sources: {}, + settings: { + outputSelection: { + '*': { + '*': ['*'] + } + } + } + } + + input.sources[file] = { content } + return JSON.stringify(input) +} + +// we try to comple this solidty file +const fileName = 'MyContract.sol' + +// now we get the output +const output = JSON.parse(solc.compile(constructInput(fileName))) + +let abi +let bin + +// `output` here contains the JSON output as specified in the documentation +for (var contractName in output.contracts[fileName]) { + let contractAbi = output.contracts[fileName][contractName].abi + let contractBin = output.contracts[fileName][contractName].evm.bytecode.object + if (contractAbi) { + abi = contractAbi + } + if (contractBin) { + bin = contractBin + } +} + +// To test with different settings, here is some config. + +const Settings = { + Ropsten: { + http: 'https://ropsten.infura.io/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + ws: 'wss://ropsten.infura.io/ws/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + type: ChainType.Ethereum, + id: ChainID.Ropsten + }, + Rinkeby: { + http: 'https://rinkeby.infura.io/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + ws: 'wss://rinkeby.infura.io/ws/v3/4f3be7f5bbe644b7a8d95c151c8f52ec', + type: ChainType.Ethereum, + id: ChainID.Ropsten + }, + Ganache: { + http: 'http://localhost:18545', + ws: 'ws://localhost:18545', + type: ChainType.Ethereum, + id: ChainID.Ganache + } +} + +// a function that will map the setting to harmony class constructor inputs +function useSetting(setting, providerType) { + return [setting[providerType], setting.type, setting.id] +} + +// simply change `Ropsten` to `Rinkeby` to test with different testnet +// and switch `ws` or `http` as RPC provider + +const harmony = new Harmony(...useSetting(Settings.Ropsten, 'ws')) + +// import our preset mnes +const mne = + 'food response winner warfare indicate visual hundred toilet jealous okay relief tornado' + +// now we have the mnes added to wallet +const acc1 = harmony.wallet.addByMnemonic(mne, 0) + +// now we create contract using extracted abi +const myContract = harmony.contracts.createContract(abi) + +// harmony.messenger.send(RPCMethod.BlockNumber, []).then(console.log); + +// harmony.messenger.subscribe(RPCMethod.Subscribe, ['newHeads']).then((res) => { +// res.onData((data) => { +// console.log(data); +// }); +// }); + +// first we get the account's balance to see if we have enough token on the testnet +acc1.getBalance().then(res => { + console.log(`-- hint: account balance of ${acc1.address}`) + console.log(``) + console.log({ account: res }) + console.log(``) + console.log(``) +}) + +// a deploy contract function +const deployContract = async () => { + //`Contract.deploy().send()` + const deployed = await myContract + .deploy({ + // the data key puts in the bin file with `0x` prefix + data: `0x${bin}`, + // we don't have any initial arguments to put in of this contract, so we leave blank + arguments: [] + }) + .send({ + // gasLimit defines the max value that blockchain will consume + // here we show that you can use Unit as calculator + // because we use BN as our save integer as default input + // use Unit converter is much safer + gasLimit: new harmony.utils.Unit('1000000').asWei().toWei(), + // gasPrice defines how many weis should be consumed each gas + // you can use `new BN(string)` directly, + // if you are sure about the amount is calculated in `wei` + gasPrice: new harmony.crypto.BN('10000') + }) + // we use event emitter to listen the result when event happen + // here comes in the `transactionHash` + .on('transactionHash', transactionHash => { + console.log(`-- hint: we got Transaction Hash`) + console.log(``) + console.log(`${transactionHash}`) + console.log(``) + console.log(``) + + harmony.blockchain + .getTransactionByHash({ + txnHash: transactionHash + }) + .then(res => { + console.log(`-- hint: we got transaction detail`) + console.log(``) + console.log(res) + console.log(``) + console.log(``) + }) + }) + // when we get receipt, it will emmit + .on('receipt', receipt => { + console.log(`-- hint: we got transaction receipt`) + console.log(``) + console.log(receipt) + console.log(``) + console.log(``) + }) + // the http and websocket provider will be poll result and try get confirmation from time to time. + // when `confirmation` comes in, it will be emitted + .on('confirmation', confirmation => { + console.log(`-- hint: the transaction is`) + console.log(``) + console.log(confirmation) + console.log(``) + console.log(``) + }) + // if something wrong happens, the error will be emitted + .on('error', error => { + console.log(`-- hint: something wrong happens`) + console.log(``) + console.log(error) + console.log(``) + console.log(``) + }) + return deployed +} + +// now we call our deploy contract function +deployContract().then(deployed => { + // after the contract is deployed ,we can get contract information + // first we can get the contract Code + harmony.blockchain.getCode({ address: deployed.address }).then(res => { + if (res.result) { + console.log(`--hint: contract :${deployed.address}--`) + console.log(``) + console.log(`${res.result}`) + console.log(``) + console.log(``) + deployed.methods + .myFunction() + .call() + .then(result => { + console.log(`--hint: we got contract called, this is result`) + console.log(``) + console.log(result) + console.log(``) + console.log(``) + }) + } + }) +}) + +// const newPendingTransactions = harmony.blockchain.newPendingTransactions(); + +// newPendingTransactions.onData((res) => { +// console.log('------- new pending coming ---'); +// console.log(res.params.result); +// console.log('----------'); +// }); diff --git a/nodejs/testGanache.js b/nodejs/testGanache.js new file mode 100644 index 0000000..2d43f77 --- /dev/null +++ b/nodejs/testGanache.js @@ -0,0 +1,294 @@ +const { Harmony } = require('@harmony-js/core') +const { ChainID, ChainType } = require('@harmony-js/utils') +const { + SubscribeBlockTracker, + SubscriptionMethod +} = require('@harmony-js/network') + +const ganache = require('ganache-cli') + +const port = 18545 + +const url = `http://localhost:${port}` + +const wsUrl = `ws://localhost:${port}` + +const mne = + 'food response winner warfare indicate visual hundred toilet jealous okay relief tornado' + +console.log('--- hint: please write these down') +console.log('-------------------------------------') +console.log(`${mne}`) +console.log('-------------------------------------') + +// we use ChainType='hmy' to indicate we are using `harmony node` +// if we set it to 'eth', we use `eth` as our settings. +// here 'eth' is used, which means we use ethereum-node. + +console.log(ChainType) + +const harmony = new Harmony(wsUrl, ChainType.Ethereum, ChainID.Geth) + +const wsHarmony = new Harmony(wsUrl, ChainType.Ethereum, ChainID.Geth) + +async function createAndEncrypt(words, index, password) { + for (let i = 0; i < index; i++) { + const newAcc = harmony.wallet.addByMnemonic(words, i) + await harmony.wallet.encryptAccount(newAcc.address, password) + } +} + +const acc = harmony.wallet.addByMnemonic(mne, 0) + +console.log('--- hint: we use this private key to test with ganache') +console.log('-------------------------------------') +console.log(`${acc.privateKey}`) +console.log('-------------------------------------') + +const server = ganache.server({ + accounts: [{ secretKey: acc.privateKey, balance: '0x21e19e0c9bab2400000' }], + default_balance_ether: 10000, + gasLimit: '0x3000000', + allowUnlimitedContractSize: true +}) + +// now it is async time + +async function main() { + const password = '1234567890123' + + await createAndEncrypt(mne, 10, password) + + // harmony.blockchain.newPendingTransacitons(); + + const latestBalance = await harmony.blockchain.getBalance({ + address: acc.address, + blockNumber: 'latest' + }) + console.log('--- testing: hmy_getBalance') + console.log('-------------------------------------') + console.log({ balance: harmony.utils.hexToNumber(latestBalance.result) }) + console.log('-------------------------------------') + + const nonce = await harmony.blockchain.getTransactionCount({ + address: harmony.wallet.signer.address, + blockNumber: 'latest' + }) + console.log('--- testing: hmy_getTransactionCount') + console.log('-------------------------------------') + console.log({ + nonce: Number.parseInt(harmony.utils.hexToNumber(nonce.result), 10) + }) + console.log('-------------------------------------') + + const balanceOfAccount = await harmony.wallet.signer.getBalance() + + console.log('--- testing: Account.getBalance') + console.log('-------------------------------------') + console.log(balanceOfAccount) + console.log('-------------------------------------') + + const sendTo = '0xccaed3f53bd0a55db215cc58182969e59d2242fe' + + const txn = harmony.transactions.newTx({ + to: sendTo, + value: new harmony.utils.Unit('1234567').asWei().toWei(), + gasLimit: new harmony.utils.Unit('21000').asWei().toWei(), + gasPrice: new harmony.utils.Unit('100000000000').asWei().toWei() + }) + + // now we sign and send a transaction + + const signed = await harmony.wallet.signTransaction(txn, undefined, password) + + console.log('--- testing: Account.signTransaction') + console.log('-------------------------------------') + console.log({ signedTransactionPayload: signed.txPayload }) + console.log('-------------------------------------') + + const [sentTxn, TranID] = await signed.sendTransaction() + + console.log('--- testing: Transaction.sendTransaction') + console.log('-------------------------------------') + console.log({ TranID }) + console.log('-------------------------------------') + + const confirmed = await sentTxn.confirm(TranID, 20, 1000) + + console.log('--- testing: Transaction.confirm') + console.log('-------------------------------------') + console.log({ + confirmed: confirmed.isConfirmed(), + receipt: confirmed.receipt + }) + console.log('-------------------------------------') + + const latestBlock = await harmony.blockchain.getBlockByNumber({ + blockNumber: 'latest' + }) + console.log('--- testing: hmy_getBlockByNumber') + console.log('-------------------------------------') + console.log({ latestBlockHash: latestBlock.result.hash }) + console.log('-------------------------------------') + + const sameLatestBlock = await harmony.blockchain.getBlockByHash({ + blockHash: latestBlock.result.hash + }) + console.log('--- testing: hmy_getBlockByHash') + console.log('-------------------------------------') + console.log({ sameLatestBlockNumber: sameLatestBlock.result.number }) + console.log('-------------------------------------') + + const blockTransactionCount = await harmony.blockchain.getBlockTransactionCountByHash( + { + blockHash: latestBlock.result.hash + } + ) + console.log('--- testing: hmy_getBlockTransactionCountByHash') + console.log('-------------------------------------') + console.log(blockTransactionCount.result) + console.log('-------------------------------------') + + const sameBlockTransactionCount = await harmony.blockchain.getBlockTransactionCountByNumber( + { + blockNumber: latestBlock.result.number + } + ) + console.log('--- testing: hmy_getBlockTransactionCountByNumber') + console.log('-------------------------------------') + console.log(sameBlockTransactionCount.result) + console.log('-------------------------------------') + + const transaction = await harmony.blockchain.getTransactionByBlockHashAndIndex( + { + blockHash: latestBlock.result.hash, + index: '0x0' + } + ) + console.log('--- testing: hmy_getTransactionByBlockHashAndIndex') + console.log('-------------------------------------') + console.log(transaction.result) + console.log('-------------------------------------') + + const sameTransaction = await harmony.blockchain.getTransactionByBlockNumberAndIndex( + { + blockNumber: latestBlock.result.number, + index: '0x0' + } + ) + console.log('--- testing: hmy_getTransactionByBlockNumberAndIndex') + console.log('-------------------------------------') + console.log({ gas: sameTransaction.result.gas }) + console.log('-------------------------------------') + + const sameTransaction2 = await harmony.blockchain.getTransactionByHash({ + txnHash: transaction.result.hash + }) + const { gas, gasPrice, value } = sameTransaction2.result + const valueBN = harmony.utils.hexToBN(value) + const gasBN = harmony.utils.hexToBN(gas) + const gasPriceBN = harmony.utils.hexToBN(gasPrice) + const actualCost = new harmony.utils.Unit(gasBN.mul(gasPriceBN).add(valueBN)) + .asWei() + .toWei() + console.log('--- testing: hmy_getTransactionByHash') + console.log('-------------------------------------') + console.log({ + actualCost: actualCost.toString(), + gas: harmony.utils.hexToNumber(gas), + gasPrice: gasPriceBN.toString(), + value: valueBN.toString(), + comment: 'actualCost= gas * gasPrice + value' + }) + console.log('-------------------------------------') + + const getBalanceAgainObject = await harmony.wallet.signer.getBalance() + console.log('--- testing: get balance again') + console.log('-------------------------------------') + console.log(getBalanceAgainObject) + console.log('-------------------------------------') + + setTimeout(async () => { + const txn2 = harmony.transactions.clone(txn) + const s2 = await harmony.wallet.signTransaction(txn2, undefined, password) + const [sentTxn, TranID] = await s2.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 5000) + + setTimeout(async () => { + const txn3 = harmony.transactions.clone(txn) + const s3 = await harmony.wallet.signTransaction(txn3, undefined, password) + const [sentTxn, TranID] = await s3.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 10000) + setTimeout(async () => { + const txns3 = harmony.transactions.clone(txn) + const s3 = await harmony.wallet.signTransaction(txns3, undefined, password) + const [sentTxn, TranID] = await s3.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 15000) + setTimeout(async () => { + const txn4 = harmony.transactions.clone(txn) + const s4 = await harmony.wallet.signTransaction(txn4, undefined, password) + const [sentTxn, TranID] = await s4.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 20000) + setTimeout(async () => { + const txn5 = harmony.transactions.clone(txn) + const s5 = await harmony.wallet.signTransaction(txn5, undefined, password) + const [sentTxn, TranID] = await s5.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 25000) + setTimeout(async () => { + const txn6 = harmony.transactions.clone(txn) + const s6 = await harmony.wallet.signTransaction(txn6, undefined, password) + const [sentTxn, TranID] = await s6.sendTransaction() + await sentTxn.confirm(TranID, 20, 1000) + console.log({ + id: sentTxn.id, + blockNumbers: sentTxn.blockNumbers, + txStatus: sentTxn.txStatus, + confirmations: sentTxn.confirmations, + confirmationCheck: sentTxn.confirmationCheck + }) + }, 30000) +} + +server.listen(port, function(err, blockchain) { + main() +}) diff --git a/nodejs/testNode.js b/nodejs/testNode.js new file mode 100644 index 0000000..96db374 --- /dev/null +++ b/nodejs/testNode.js @@ -0,0 +1,136 @@ +const { Harmony } = require('@harmony-js/core') +// const ganache = require('ganache-cli'); + +var port = 9015 + +const url = `http://localhost:${port}` +// const url = `https://testnet-rpc.thundercore.com:8544`; + +// we use ChainType=0 to indicate we are using `harmony node` +// if we set it to 1, we use `eth` as our settings. +// here 0 is by default, which means we use harmony-node by default. +const harmony = new Harmony(url) + +const mne = + 'food response winner warfare indicate visual hundred toilet jealous okay relief tornado' + +const acc = harmony.wallet.addByMnemonic(mne, 0) + +console.log('--- hint: please write these down') +console.log('-------------------------------------') +console.log(`${mne}`) +console.log('-------------------------------------') + +console.log('--- hint: we use this private key to as default account to test') +console.log('-------------------------------------') +console.log(`${acc.privateKey}`) +console.log('-------------------------------------') + +// now it is async time + +async function main() { + const latestBlock = await harmony.blockchain.getBlockByNumber({ + blockNumber: 'latest' + }) + console.log('--- testing: hmy_getBlockNumber') + console.log('-------------------------------------') + console.log(latestBlock.result) + console.log('-------------------------------------') + + const sameLatestBlock = await harmony.blockchain.getBlockByHash({ + blockHash: latestBlock.result.hash + }) + console.log('--- testing: hmy_getBlockByHash') + console.log('-------------------------------------') + console.log(sameLatestBlock.result) + console.log('-------------------------------------') + + const blockTransactionCount = await harmony.blockchain.getBlockTransactionCountByHash( + { + blockHash: latestBlock.result.hash + } + ) + console.log('--- testing: hmy_getBlockTransactionCountByHash') + console.log('-------------------------------------') + console.log(blockTransactionCount.result) + console.log('-------------------------------------') + + const sameBlockTransactionCount = await harmony.blockchain.getBlockTransactionCountByNumber( + { + blockNumber: latestBlock.result.number + } + ) + console.log('--- testing: hmy_getBlockTransactionCountByNumber') + console.log('-------------------------------------') + console.log(sameBlockTransactionCount.result) + console.log('-------------------------------------') + + const transaction = await harmony.blockchain.getTransactionByBlockHashAndIndex( + { + blockHash: latestBlock.result.hash, + index: '0x0' + } + ) + console.log('--- testing: hmy_getTransactionByBlockHashAndIndex') + console.log('-------------------------------------') + console.log(transaction.result) + console.log('-------------------------------------') + + const sameTransaction = await harmony.blockchain.getTransactionByBlockNumberAndIndex( + { + blockNumber: latestBlock.result.number, + index: '0x0' + } + ) + console.log('--- testing: hmy_getTransactionByBlockNumberAndIndex') + console.log('-------------------------------------') + console.log(sameTransaction.result) + console.log('-------------------------------------') + + const sameTransaction2 = await harmony.blockchain.getTransactionByHash({ + txnHash: transaction.result.hash + }) + console.log('--- testing: hmy_getTransactionByHash') + console.log('-------------------------------------') + console.log(sameTransaction2.result) + console.log('-------------------------------------') + + const latestBalance = await harmony.blockchain.getBalance({ + address: acc.address, + blockNumber: latestBlock.result.number + }) + console.log('--- testing: hmy_getBalance') + console.log('-------------------------------------') + console.log({ balance: harmony.utils.hexToNumber(latestBalance.result) }) + console.log('-------------------------------------') + + const latestBalance2 = await harmony.blockchain.getBalance({ + address: acc.address, + blockNumber: 'latest' + }) + console.log( + '--- testing: force blockNumber to "latest", should get same result as above' + ) + console.log('-------------------------------------') + console.log({ balance: harmony.utils.hexToNumber(latestBalance2.result) }) + console.log('-------------------------------------') + + const nonce = await harmony.blockchain.getTransactionCount({ + address: acc.address, + blockNumber: latestBlock.result.number + }) + console.log('--- testing: hmy_getTransactionCount') + console.log('-------------------------------------') + console.log({ + nonce: Number.parseInt(harmony.utils.hexToNumber(nonce.result), 10) + }) + console.log('-------------------------------------') + + const balanceOfAccount = await acc.getBalance() + console.log('--- testing: Account.getBalance') + console.log('-------------------------------------') + console.log(balanceOfAccount) + console.log('-------------------------------------') +} + +main() diff --git a/nodejs/testWallet.js b/nodejs/testWallet.js new file mode 100644 index 0000000..1e5a391 --- /dev/null +++ b/nodejs/testWallet.js @@ -0,0 +1,32 @@ +const { Harmony } = require('@harmony-js/core') + +const harmony = new Harmony('https://localhost:9015') + +async function createAndEncrypt(words, index, password) { + for (let i = 0; i < index; i++) { + const newAcc = harmony.wallet.addByMnemonic(words, i) + await harmony.wallet.encryptAccount(newAcc.address, password) + } +} + +async function main() { + // const mne = harmony.wallet.generateMnemonic(); + const mne = + 'food response winner warfare indicate visual hundred toilet jealous okay relief tornado' + const password = '1234567890123' + console.log('---hint: please write these down') + console.log(`${mne}`) + + console.log('---hint: we use simple password to encrypt your wallet') + console.log(`${password}`) + + await createAndEncrypt(mne, 10, password) + console.log('---hint:we added 10 accounts for you') + + console.log(harmony.wallet.accounts) + + console.log('---hint:now the signer has been encrypted') + console.log(harmony.wallet.signer.privateKey) +} + +main() diff --git a/package.json b/package.json new file mode 100644 index 0000000..3cf2a5d --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "harmony-sdk-examples", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "@harmony-js/core": "^0.0.15" + }, + "devDependencies": { + "ganache-cli": "^6.4.3", + "solc": "^0.5.8", + "tslib": "^1.9.3" + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..c583ac0 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,965 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@harmony-js/account@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/account/-/account-0.0.15.tgz#a86263f2267a9560a3974077aec7cecf5b8540a1" + integrity sha512-ZGXeqOBKH8NoZ83GWr1qVDBXP67evXPATccHfA7sW743AEKN+gfuzbQLhYDGJFN/65i202R0taREwq2QtO4sNQ== + dependencies: + "@harmony-js/core" "0.0.15" + "@harmony-js/crypto" "0.0.15" + "@harmony-js/network" "0.0.15" + "@harmony-js/transaction" "0.0.15" + "@harmony-js/utils" "0.0.15" + +"@harmony-js/contract@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/contract/-/contract-0.0.15.tgz#f643e22967b081b7c7d966f85631b9b7545a4717" + integrity sha512-YBCypIfxW90/gi8SR34sNs+PjppatpLWE24Jl/AYC3XBDEUsVgtjof/7uPUm4/HV60Jz2LzxJmm0E3IU4VSjsw== + dependencies: + "@harmony-js/account" "0.0.15" + "@harmony-js/crypto" "0.0.15" + "@harmony-js/network" "0.0.15" + "@harmony-js/transaction" "0.0.15" + "@harmony-js/utils" "0.0.15" + +"@harmony-js/core@0.0.15", "@harmony-js/core@^0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/core/-/core-0.0.15.tgz#71c0b1c5ff598013498bde8536a5970953d303e3" + integrity sha512-AngDkTMjx7da57bGib9lI07No7mFrajzdtr9tuVUYfNOS92vKx1slFB6cmpMUlTYUMnLm5RLLIXBvOtumeKnNg== + dependencies: + "@harmony-js/account" "0.0.15" + "@harmony-js/contract" "0.0.15" + "@harmony-js/crypto" "0.0.15" + "@harmony-js/network" "0.0.15" + "@harmony-js/transaction" "0.0.15" + "@harmony-js/utils" "0.0.15" + +"@harmony-js/crypto@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/crypto/-/crypto-0.0.15.tgz#7671ad3dbc0bed66dc1e89fefe393987b5fd2337" + integrity sha512-7rqzEzspAdUk4Ej4w/vMiKzj6TtzIo1HaAE0by/OX9xds+00xDJzdavHELtkrat1kuc+fkx1mJ9jlfCp5Kmp5A== + dependencies: + "@harmony-js/utils" "0.0.15" + aes-js "^3.1.2" + base-x "^3.0.5" + bip39 "^2.5.0" + bn.js "^4.11.8" + elliptic "^6.4.1" + hdkey "^1.1.1" + hmac-drbg "^1.0.1" + js-sha3 "^0.8.0" + pbkdf2 "^3.0.17" + scrypt.js "^0.3.0" + uuid "^3.3.2" + +"@harmony-js/network@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/network/-/network-0.0.15.tgz#8e59f2f1bf93b63c4bacc8e11db9d341864bbf7a" + integrity sha512-iYo7MdR6D+RfIFkT3/Vx8bJFxoLKJ3LJkTa7WyVtnHpGi8r6uA6uOhX+lQJY6FlatX2tSHPT3HN694kiQm3/xA== + dependencies: + "@harmony-js/core" "0.0.15" + "@harmony-js/utils" "0.0.15" + cross-fetch "^3.0.2" + mitt "^1.1.3" + websocket "^1.0.28" + +"@harmony-js/transaction@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/transaction/-/transaction-0.0.15.tgz#734067e6f5fee5bf9dfd50520f77480624dd0289" + integrity sha512-k9GT3WYLdEKu9fwBSQZ4xbIdMI7pO6GrgcSQAFx4vYHneK5PMWeJN/Dd8mXmxI/QQMIpTqKqqYbjqrXMc3fMUQ== + dependencies: + "@harmony-js/core" "0.0.15" + "@harmony-js/crypto" "0.0.15" + "@harmony-js/network" "0.0.15" + "@harmony-js/utils" "0.0.15" + +"@harmony-js/utils@0.0.15": + version "0.0.15" + resolved "https://registry.npmjs.org/@harmony-js/utils/-/utils-0.0.15.tgz#5a90429b6115394f11942bc71ee25fb99712e22a" + integrity sha512-P48ImNxHZKcLx23uXnjUyQW7m0Fav32OW5Y9gthaM2BNyLxGowbN1W7LGCNMlk0gd+Y3N2FLC994jWxoQMhhOw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.8" + +"@types/bn.js@^4.11.3": + version "4.11.5" + resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.5.tgz#40e36197433f78f807524ec623afcf0169ac81dc" + integrity sha512-AEAZcIZga0JgVMHNtl1CprA/hXX7/wPt79AgR4XqaDt7jyj3QWYw6LPoOiznPtugDmlubUnAahMs2PFxGcQrng== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "12.0.2" + resolved "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40" + integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA== + +aes-js@^3.1.2: + version "3.1.2" + resolved "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz#db9aabde85d5caabbfc0d4f2a4446960f627146a" + integrity sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base-x@^3.0.5: + version "3.0.5" + resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.5.tgz#d3ada59afed05b921ab581ec3112e6444ba0795a" + integrity sha512-C3picSgzPSLE+jW3tcBzJoGwitOtazb5B+5YmAxZm2ybmTi9LNgAtDO/jjVEBZwHoXmDBZ9m/IELj3elJVRBcA== + dependencies: + safe-buffer "^5.0.1" + +bindings@^1.2.1, bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bip39@^2.5.0: + version "2.6.0" + resolved "https://registry.npmjs.org/bip39/-/bip39-2.6.0.tgz#9e3a720b42ec8b3fbe4038f1e445317b6a99321c" + integrity sha512-RrnQRG2EgEoqO24ea+Q/fftuPUZLmrEM3qNhhGsA3PbaXaCW791LTzPuVyx/VprXQcTbPJ3K3UeTna8ZnVl2sg== + dependencies: + create-hash "^1.1.0" + pbkdf2 "^3.0.9" + randombytes "^2.0.1" + safe-buffer "^5.0.1" + unorm "^1.3.3" + +bip66@^1.1.5: + version "1.1.5" + resolved "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" + integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= + dependencies: + safe-buffer "^5.0.1" + +bn.js@4.11.8, bn.js@^4.11.8, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= + +browserify-aes@^1.0.6: + version "1.2.0" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^2.0.1: + version "2.0.1" + resolved "https://registry.npmjs.org/bs58/-/bs58-2.0.1.tgz#55908d58f1982aba2008fa1bed8f91998a29bf8d" + integrity sha1-VZCNWPGYKrogCPob7Y+RmYopv40= + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +coinstring@^2.0.0: + version "2.3.0" + resolved "https://registry.npmjs.org/coinstring/-/coinstring-2.3.0.tgz#cdb63363a961502404a25afb82c2e26d5ff627a4" + integrity sha1-zbYzY6lhUCQEolr7gsLibV/2J6Q= + dependencies: + bs58 "^2.0.1" + create-hash "^1.1.1" + +command-exists@^1.2.8: + version "1.2.8" + resolved "https://registry.npmjs.org/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" + integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +create-hash@^1.1.0, create-hash@^1.1.1, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-fetch@^3.0.2: + version "3.0.2" + resolved "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.0.2.tgz#b7136491967031949c7f86b15903aef4fa3f1768" + integrity sha512-a4Z0EJ5Nck6QtMy9ZqloLfpvu2uMV3sBfMCR+CgSBCZc6z5KR4bfEiD3dkepH8iZgJMXQpTqf8FjMmvu/GMFkg== + dependencies: + node-fetch "2.3.0" + whatwg-fetch "3.0.0" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@^2.2.0: + version "2.6.9" + resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +drbg.js@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" + integrity sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs= + dependencies: + browserify-aes "^1.0.6" + create-hash "^1.1.2" + create-hmac "^1.1.4" + +elliptic@^6.4.1: + version "6.4.1" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +fs-extra@^0.30.0: + version "0.30.0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + integrity sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A= + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" + rimraf "^2.2.8" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +ganache-cli@^6.4.3: + version "6.4.3" + resolved "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.4.3.tgz#2fb66c10f9df157b2cd9aeaf007a9fd47cd79cb1" + integrity sha512-3G+CK4ojipDvxQHlpX8PjqaOMRWVcaLZZSW97Bv7fdcPTXQwkji2yY5CY6J12Atiub4M4aJc0va+q3HXeerbIA== + dependencies: + bn.js "4.11.8" + source-map-support "0.5.9" + yargs "11.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: + version "4.1.15" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hdkey@^1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/hdkey/-/hdkey-1.1.1.tgz#c2b3bfd5883ff9529b72f2f08b28be0972a9f64a" + integrity sha512-DvHZ5OuavsfWs5yfVJZestsnc3wzPvLWNk6c2nRUfo6X+OtxypGt20vDDf7Ba+MJzjL3KS1og2nw2eBbLCOUTA== + dependencies: + coinstring "^2.0.0" + safe-buffer "^5.1.1" + secp256k1 "^3.0.1" + +hmac-drbg@^1.0.0, hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3: + version "2.0.3" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-typedarray@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +js-sha3@^0.8.0: + version "0.8.0" + resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + integrity sha1-NzaitCi4e72gzIO1P6PWM6NcKug= + optionalDependencies: + graceful-fs "^4.1.6" + +keccak@^1.0.2: + version "1.4.0" + resolved "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" + integrity sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw== + dependencies: + bindings "^1.2.1" + inherits "^2.0.3" + nan "^2.2.1" + safe-buffer "^5.1.0" + +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + integrity sha1-QIhDO0azsbolnXh4XY6W9zugJDk= + optionalDependencies: + graceful-fs "^4.1.9" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= + dependencies: + invert-kv "^1.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= + dependencies: + mimic-fn "^1.0.0" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha1-htcJCzDORV1j+64S3aUaR93K+bI= + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +mitt@^1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/mitt/-/mitt-1.1.3.tgz#528c506238a05dce11cd914a741ea2cc332da9b8" + integrity sha512-mUDCnVNsAi+eD6qA0HkRkwYczbLHJ49z17BGe2PYRhZL4wpZUFZGJHU7/5tmvohoma+Hdn0Vh/oJTiPEmgSruA== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +nan@^2.0.8, nan@^2.11.0, nan@^2.13.2, nan@^2.2.1: + version "2.14.0" + resolved "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== + +node-fetch@2.3.0: + version "2.3.0" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" + integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +pbkdf2@^3.0.17, pbkdf2@^3.0.3, pbkdf2@^3.0.9: + version "3.0.17" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +randombytes@^2.0.1: + version "2.1.0" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-from-string@^2.0.0: + version "2.0.2" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +rimraf@^2.2.8: + version "2.6.3" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2: + version "5.1.2" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +scrypt.js@^0.3.0: + version "0.3.0" + resolved "https://registry.npmjs.org/scrypt.js/-/scrypt.js-0.3.0.tgz#6c62d61728ad533c8c376a2e5e3e86d41a95c4c0" + integrity sha512-42LTc1nyFsyv/o0gcHtDztrn+aqpkaCNt5Qh7ATBZfhEZU7IC/0oT/qbBH+uRNoAPvs2fwiOId68FDEoSRA8/A== + dependencies: + scryptsy "^1.2.1" + optionalDependencies: + scrypt "^6.0.2" + +scrypt@^6.0.2: + version "6.0.3" + resolved "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz#04e014a5682b53fa50c2d5cce167d719c06d870d" + integrity sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0= + dependencies: + nan "^2.0.8" + +scryptsy@^1.2.1: + version "1.2.1" + resolved "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz#a3225fa4b2524f802700761e2855bdf3b2d92163" + integrity sha1-oyJfpLJST4AnAHYeKFW987LZIWM= + dependencies: + pbkdf2 "^3.0.3" + +secp256k1@^3.0.1: + version "3.7.0" + resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.0.tgz#e85972f847b586cc4b2acd69497d3f80afaa7505" + integrity sha512-YlUIghD6ilkMkzmFJpIdVjiamv2S8lNZ9YMwm1XII9JC0NcR5qQiv2DOp/G37sExBtaMStzba4VDJtvBXEbmMQ== + dependencies: + bindings "^1.5.0" + bip66 "^1.1.5" + bn.js "^4.11.8" + create-hash "^1.2.0" + drbg.js "^1.0.1" + elliptic "^6.4.1" + nan "^2.13.2" + safe-buffer "^5.1.2" + +semver@^5.5.0: + version "5.7.0" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +solc@^0.5.8: + version "0.5.8" + resolved "https://registry.npmjs.org/solc/-/solc-0.5.8.tgz#a0aa2714082fc406926f5cb384376d7408080611" + integrity sha512-RQ2SlwPBOBSV7ktNQJkvbiQks3t+3V9dsqD014EdstxnJzSxBuOvbt3P5QXpNPYW1DsEmF7dhOaT3JL7yEae/A== + dependencies: + command-exists "^1.2.8" + fs-extra "^0.30.0" + keccak "^1.0.2" + memorystream "^0.3.1" + require-from-string "^2.0.0" + semver "^5.5.0" + tmp "0.0.33" + yargs "^11.0.0" + +source-map-support@0.5.9: + version "0.5.9" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tslib@^1.9.3: + version "1.9.3" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + +unorm@^1.3.3: + version "1.5.0" + resolved "https://registry.npmjs.org/unorm/-/unorm-1.5.0.tgz#01fa9b76f1c60f7916834605c032aa8962c3f00a" + integrity sha512-sMfSWoiRaXXeDZSXC+YRZ23H4xchQpwxjpw1tmfR+kgbBCaOgln4NI0LXejJIhnBuKINrB3WRn+ZI8IWssirVw== + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +websocket@^1.0.28: + version "1.0.28" + resolved "https://registry.npmjs.org/websocket/-/websocket-1.0.28.tgz#9e5f6fdc8a3fe01d4422647ef93abdd8d45a78d3" + integrity sha512-00y/20/80P7H4bCYkzuuvvfDvh+dgtXi5kzDf3UcZwN6boTYaKvsrtZ5lIYm1Gsg48siMErd9M4zjSYfYFHTrA== + dependencies: + debug "^2.2.0" + nan "^2.11.0" + typedarray-to-buffer "^3.1.5" + yaeti "^0.0.6" + +whatwg-fetch@3.0.0: + version "3.0.0" + resolved "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.npmjs.org/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= + +yaeti@^0.0.6: + version "0.0.6" + resolved "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" + integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@^9.0.2: + version "9.0.2" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" + integrity sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc= + dependencies: + camelcase "^4.1.0" + +yargs@11.1.0, yargs@^11.0.0: + version "11.1.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" + integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A== + dependencies: + cliui "^4.0.0" + decamelize "^1.1.1" + find-up "^2.1.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^9.0.2"