message: funding amount as an option
diff: import program from 'commander';
  import Web3 from 'web3';
  +import BN from 'bn.js';
  import CONFIG from '../config/config.json';
  const web3 = new Web3(CONFIG.config.WEB3_URL);
  -const one = web3.utils.toWei('1');
  program.option('-f, --fundingAccount <string>', 'funding account private key');
  +program.option('-v, --value <ewt>', 'value of the funding tx (default: 1EWT)', '1');
  program.parse(process.argv);
  @@ -23,8 +24,19 @@ if (!hasCorrectPrivateKey) {
  process.exit(1);
  }
  -const processAssets = async assets => {
  +const processAssets = async (assets: any[]) => {
  const fundingAccount = web3.eth.accounts.privateKeyToAccount(program.fundingAccount);
  + const value = web3.utils.toWei(program.value);
  + const fundingAccountBalance = await web3.eth.getBalance(fundingAccount.address);
  + const required = new BN(value).mul(new BN(assets.length));
  +
  + if (required.gt(new BN(fundingAccountBalance.toString()))) {
  + console.log(required.gt(fundingAccountBalance));
  + console.error(
  + `Not enough funds on funding account. Required ${required} has ${fundingAccountBalance}`
  + );
  + process.exit(1);
  + }
  console.log(`Using ${fundingAccount.address} as funding account`);
  @@ -37,13 +49,14 @@ const processAssets = async assets => {
  const signedTx = await fundingAccount.signTransaction({
  to,
  gas: 21000,
  - value: one
  + gasPrice: '1',
  + value
  });
  const fundingTx = await web3.eth.sendSignedTransaction(signedTx.rawTransaction);
  console.log(
  - `Funding tx from ${fundingAccount.address} to ${to} has been broadcasted ${fundingTx.transactionHash}`
  + `Funding ${value} (${program.value}ewt) from ${fundingAccount.address} to ${to} has been broadcasted ${fundingTx.transactionHash}`
  );
  }
  };
  