Accepts as params the fields from Apply page form #14, plus borrower eth address,
Borrower eth address
Amount
Duration (days)
History (may be array, 0 (no history) or -1 (do not lend))
Story (optional - for future functionality)
Compare these to lender's settings from db.
Choose a lender (based on preferences?)
EDIT:
If borrower has a loan offer in db already, use that.
/EDIT
If borrower meets criteria for a loan and does not already have anything outstanding on a loan
store details as an 'offer' in db and
respond with an object containing tx: a smart contract transaction object with as many mandatory fields filled as poss, AND a unique nonce.
See transaction structure and comment.
data field is a todo for later #21.
Liase with @jignasheth407 #14
Set an environment variable CONTRACT_ADDR in .env and use this in tx as to:
var tx = {
from: borrowerEthAddr,
to: contractAddr, // use env2 to set this as app constant - '0x12345' is fine
gasPrice: "9000000000",
gas: "85000",
data: ""
};
I suggest name the endpoint /offers
Accepts as params the fields from Apply page form #14, plus borrower eth address,
Compare these to lender's settings from db. Choose a lender (based on preferences?)
EDIT: If borrower has a loan offer in db already, use that. /EDIT
If borrower meets criteria for a loan and does not already have anything outstanding on a loan store details as an 'offer' in db and respond with an object containing tx: a smart contract transaction object with as many mandatory fields filled as poss, AND a unique nonce. See transaction structure and comment. data field is a todo for later #21.
Liase with @jignasheth407 #14
Set an environment variable CONTRACT_ADDR in .env and use this in tx as to: