From 676c0fcb3669b5bc4267004db4cf3c30bf57bf7e Mon Sep 17 00:00:00 2001 From: sairajzero Date: Thu, 29 Apr 2021 04:34:46 +0530 Subject: [PATCH] update adding createTermString and createFundString --- index.html | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 9dcb244..67387bf 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@ }, adminID: "FKAEdnPfjXLHSYwrXQu377ugN4tXU7VGdf", application: "bobsFundTest", - productStr: "Product: Bob's Fund", + productStr: "Bob's Fund", sendAmt: 0.001, fee: 0.0005 } @@ -8342,6 +8342,38 @@ Bitcoin.Util = { //console.info(gain, interest, net) return net * USD_current; } + + function createFundString(BTC_base, USD_base, start_date, funds) { + let fList = []; + for (let f in funds) + fList.push(`${f}:${funds[f]}`) + return [ + productStr, + `Base Value: ${BTC_base} USD`, + `USD INR rate at start: ${USD_base}`, + `Fund Start date: ${dateFormat(start_date)}`, + `Funds (INR): [${fList.join(",")}]` + ].join("|"); + } + + function createTermString(floID, maxPeriod, tapoutWindow, tapoutInterval, fee = 0) { + if (Array.isArray(tapoutInterval)) { + let x = tapoutInterval.pop(), + y = tapoutInterval.join(", ") + tapoutInterval = `${y} and ${x}` + } + + return [ + productStr, + "Long term Bitcoin price based asset", + "Price are proportional directly to Bitcoin Prices", + `Bonds need to be held for ${maxPeriod}`, + `Tap out period available for ${tapoutWindow} after ${tapoutInterval}`, + `Fund Management Fees: ${fee ? fee+"%": "0 (Zero)"}`, + `Bitcoin Float can be used by the fund for meeting it's expenses`, + `Bond issuing authorized FLO ID: ${floID}` + ].join("|"); + }