Read manager
Read manager is responsible for direct blockchain interaction with the Read (Book) contract.
The source of contract that is used during development located in:contracts/ReadToken.sol - The contract is exactly the same as the live onebuild/contracts/ReadToken.json - Compiled, JSON version of the contract
constructor(address)
Constructor expects to get Read (book) contract address that you want to interact with.
address - Read (book) contract address that you want to interact with
getInstance()
Method will return or assign instance of a contract based on provided address in constructor
createInstance(owner, author, description, title, price, totalTokens, saleEndDate)
Method will create a new instance of a contract and deploy it to blockchain network
owner - wallet address of the user who will be contract owner
author - name/surname of the author of the book
description - short description of the book
title - title of the book
price - price of the book
totalTokens - total amount of tokens being sold
saleEndDate - unix timestamp for the sale end date
buy(payer)
Method will trigger buy function on the contract
payer - wallet address of the user who will be buying the Read (book) tokens