async function postCapsuleToBlockchain(summary, unlockDate, ipfsPath, aesKey, provider) {
  console.log("Posting capsule to blockchain");

  const timeCapsule = (await Web3Handler.getContract(provider, 'TimeCapsule'))
    .connect(provider.getSigner());

  // creates the time capsule in the smart contract
  const tx = await timeCapsule.createCapsule(
    summary,
    unlockDate,
    ipfsPath,
    aesKey
  );

  console.log("transaction:", tx);

  return tx;
}
/**
 * Posts the capsule to the smart contract
 * 
 * @param {string} summary The publicly visible text of the capsule
 * @param {number} unlockDate The date in unix timestamp when the capsule can be unlocked
 * @param {string} ipfsPath The path to the IPFS message
 * @param {string} aesKey The encryption key to decrypt the message
 * @param {Web3Provider} provider The web3 provider
 * @returns the transaction hash
 */
Posts the capsule to the smart contract


Posts the capsule to the smart contract
async function postCapsuleToBlockchain(summary, unlockDate, ipfsPath, aesKey, provider) {
  console.log("Posting capsule to blockchain");
  const timeCapsule = (await Web3Handler.getContract(provider, 'TimeCapsule'))
    .connect(provider.getSigner());
  const tx = await timeCapsule.createCapsule(
    summary,
    unlockDate,
    ipfsPath,
    aesKey
  );
  console.log("transaction:", tx);
  return tx;
}
async function postCapsuleToBlockchain ( summary , unlockDate , ipfsPath , aesKey , provider ) { console . log ( "Posting capsule to blockchain" ) ; const timeCapsule = ( await Web3Handler . getContract ( provider , 'TimeCapsule' ) ) . connect ( provider . getSigner ( ) ) ; const tx = await timeCapsule . createCapsule ( summary , unlockDate , ipfsPath , aesKey ) ; console . log ( "transaction:" , tx ) ; return tx ; }
Posts the capsule to the smart contract
Posts the capsule to the smart contract
// creates the time capsule in the smart contract