dist/index.common.js
function publishProof(privateKeyHex, toAddress, hash, rpcUri) {
  if (!EthereumUtil.isValidAddress(EthereumUtil.addHexPrefix(toAddress))) {
    throw new Error('Invalid destination address.');
  }

  if (!rpcUri) {
    rpcUri = localDefault;
  }

  var web3 = new Web3(
    new Web3.providers.HttpProvider(rpcUri)
  );

  var tx = buildTransaction(privateKeyHex, toAddress, hash, web3);

  var serializedTx = EthereumUtil.addHexPrefix(tx.serialize().toString('hex'));
  var txHash = web3.eth.sendRawTransaction(serializedTx);
  console.log('Transaction hash:' + txHash);
  return txHash;
}
function publishProof(privateKeyHex, toAddress, hash, rpcUri) {
  if (!EthereumUtil.isValidAddress(EthereumUtil.addHexPrefix(toAddress))) {
    throw new Error('Invalid destination address.');
  }

  if (!rpcUri) {
    rpcUri = localDefault;
  }

  var web3 = new Web3(
    new Web3.providers.HttpProvider(rpcUri)
  );

  var tx = buildTransaction(privateKeyHex, toAddress, hash, web3);

  var serializedTx = EthereumUtil.addHexPrefix(tx.serialize().toString('hex'));
  var txHash = web3.eth.sendRawTransaction(serializedTx);
  console.log('Transaction hash:' + txHash);
  return txHash;
}
function publishProof ( privateKeyHex , toAddress , hash , rpcUri ) { if ( ! EthereumUtil . isValidAddress ( EthereumUtil . addHexPrefix ( toAddress ) ) ) { throw new Error ( 'Invalid destination address.' ) ; } if ( ! rpcUri ) { rpcUri = localDefault ; } var web3 = new Web3 ( new Web3 . providers . HttpProvider ( rpcUri ) ) ; var tx = buildTransaction ( privateKeyHex , toAddress , hash , web3 ) ; var serializedTx = EthereumUtil . addHexPrefix ( tx . serialize ( ) . toString ( 'hex' ) ) ; var txHash = web3 . eth . sendRawTransaction ( serializedTx ) ; console . log ( 'Transaction hash:' + txHash ) ; return txHash ; }
Publishes a proof of existence to the Ethereum chain
@param {string} privateKeyHex - Private key as a hex string
@param {string} toAddress - Destination address
@param {string} hash - Hash as hex string
@param {string} rpcUri - Optional RPC Uri.  Defaults to http://localhost:8545
@return {string} Hex string representing hash
Publishes a proof of existence to the Ethereum chain