economicsystem-tokenroom/index.html

859 lines
42 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tokenroom Economic System</title>
<link rel="stylesheet" href="css/main.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&family=Roboto+Mono&family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet" />
<script id="floGlobals">
/* Constants for FLO blockchain operations !!Make sure to add this at beginning!! */
const floGlobals = {
blockchain: "FLO",
adminID: "FKAEdnPfjXLHSYwrXQu377ugN4tXU7VGdf",
application: "TEST_MODE",
token_api: "https://ranchimallflo.ranchimall.net"
}
</script>
</head>
<body data-theme="light" class="hide" onload="onLoadStartUp()">
<sm-notifications id="notification_drawer"></sm-notifications>
<sm-popup id="confirmation_popup">
<h4 id="confirm_title"></h4>
<p id="confirm_message"></p>
<div class="flex align-center">
<sm-button variant="no-outline" class="cancel-btn">Cancel</sm-button>
<sm-button variant="no-outline" class="submit-btn">OK</sm-button>
</div>
</sm-popup>
<sm-popup id="prompt_popup">
<h4 id="prompt_title"></h4>
<p id="prompt_message"></p>
<sm-input id="prompt_input"></sm-input>
<div class="flex align-center">
<sm-button variant="no-outline" class="cancel-btn">Cancel</sm-button>
<sm-button variant="no-outline" class="submit-btn" type="submit">OK</sm-button>
</div>
</sm-popup>
<sm-popup id="sign_in_popup">
<header slot="header" class="popup__header">
<button class="popup__header__close" onclick="hidePopup()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<path d="M0 0h24v24H0V0z" fill="none" />
<path
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z" />
</svg>
</button>
</header>
<section id="sign_in" class="grid gap-1">
<div class="grid gap-0-5">
<h3>Sign in</h3>
<p>Liking an article supports and encourages the creators.</p>
</div>
<sm-form>
<sm-input id="private_key_field" type="password" placeholder="FLO private key"
error-text="Private key is invalid" data-private-key autofocus required></sm-input>
<sm-button id="sign_in_button" class="cta" variant="primary" disabled>Sign In</sm-button>
</sm-form>
<div class="grid gap-0-5">
<p>New here? Generate your FLO credentials below to continue</p>
<sm-button class="button" onclick="generateCredentials()">
Get FLO credentials
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<path d="M0 0h24v24H0z" fill="none" />
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />
</svg>
</sm-button>
</div>
</section>
<section id="sign_up" class="grid gap-1-5 hide">
<button class="justify-self-start" onclick="goToSignIn()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<path d="M0 0h24v24H0z" fill="none" />
<path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
</svg>
</button>
<div class="grid gap-0-5">
<h3>FLO credentials</h3>
<p>You can use FLO credentials with RanchiMall Times and all RanchiMall FLO apps. </p>
</div>
<div class="grid gap-1-5 card">
<div class="grid gap-0-5">
<h5>FLO ID</h5>
<sm-copy id="generated_flo_id"></sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Private key</h5>
<sm-copy id="generated_private_key"></sm-copy>
</div>
</div>
<sm-button id="sign_up_button" variant="primary">Sign in with these credentials</sm-button>
<strong class="warning">
Keep your private key secure and don't share with anyone.
Once lost there is no way to recover private key.
</strong>
</section>
</sm-popup>
<sm-popup id="user_popup">
<header slot="header" class="popup__header">
<button class="popup__header__close" onclick="hidePopup()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" />
</svg>
</button>
<h3>Settings</h3>
</header>
<section class="grid gap-1-5">
<div class="grid gap-1">
<div class="grid">
<h5>Reset App Data?</h5>
</div>
<sm-button id='clearLocalData_button' class="danger cta justify-self-start"
onclick="clearLocalData()">Reset Data
</sm-button>
<div class="grid">
<h5>My FLO ID</h5>
<sm-copy id="user_flo_id" clip-text></sm-copy>
</div>
<sm-button id='signout_button' class="danger cta justify-self-start" onclick="signOut()">Sign out
</sm-button>
</div>
<a href="#/dashboard" class="button hide admin-option" onclick="hidePopup()">Admin dashboard</a>
</section>
</sm-popup>
<sm-popup id="tx_popup">
<header slot="header" class="popup__header">
<button class="popup__header__close" onclick="hidePopup()">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" />
</svg>
</button>
<h3>Transaction Details</h3>
</header>
<section class="grid gap-2">
<div class="grid gap-0-5">
<h5>Consumer ID</h5>
<sm-copy id='tx-popup-consumer-id'>F8dfo322CKzPAyzoFJ6SefHZ9AwAujvKXi</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Consumer Amount</h5>
<sm-copy id='tx-popup-consumer-amount'>1750</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Consumer Tokens</h5>
<sm-copy id='tx-popup-consumer-tokens'>5250</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>From date</h5>
<sm-copy id='tx-popup-consumer-fromdate'>2021-12-27</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>To date</h5>
<sm-copy id='tx-popup-consumer-todate'>2021-12-28</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Investor ID</h5>
<sm-copy id='tx-popup-investor-id'>FSAH5eajsfgXMGENZvpRTbuZTCBDGrTQQx</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Investor tokens</h5>
<sm-copy id='tx-popup-investor-tokens'>5250</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Property ID</h5>
<sm-copy id='tx-popup-property-id'>F8BPRSTD2v6PHmKSJK3puPS7jpy3Mm1Ncq</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Producer tokens</h5>
<sm-copy id='tx-popup-producer-tokens'>5250</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Referrer ID</h5>
<sm-copy id='tx-popup-referrer-id'></sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Referrer tokens</h5>
<sm-copy id='tx-popup-referrer-tokens'>0</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Technology provider tokens</h5>
<sm-copy id='tx-popup-technology-tokens'>1750</sm-copy>
</div>
<div class="grid gap-0-5">
<h5>Transaction ID</h5>
<sm-copy id='tx-popup-txid'>z0baa7ff9b7255db4fa59592ab46504ca0dd58d9f9af67dc200c6063a04e338e6c</sm-copy>
</div>
</section>
</sm-popup>
<main>
<header id="main_header" class="flex align-center space-between">
<div id="logo">
<svg id="main_logo" viewBox="0 0 27.25 32">
<title>RanchiMall</title>
<path
d="M27.14,30.86c-.74-2.48-3-4.36-8.25-6.94a20,20,0,0,1-4.2-2.49,6,6,0,0,1-1.25-1.67,4,4,0,0,1,0-2.26c.37-1.08.79-1.57,3.89-4.55a11.66,11.66,0,0,0,3.34-4.67,6.54,6.54,0,0,0,.05-2.82C20,3.6,18.58,2,16.16.49c-.89-.56-1.29-.64-1.3-.24a3,3,0,0,1-.3.72l-.3.55L13.42.94C13,.62,12.4.26,12.19.15c-.4-.2-.73-.18-.72.05a9.39,9.39,0,0,1-.61,1.33s-.14,0-.27-.13C8.76.09,8-.27,8,.23A11.73,11.73,0,0,1,6.76,2.6C4.81,5.87,2.83,7.49.77,7.49c-.89,0-.88,0-.61,1,.22.85.33.92,1.09.69A5.29,5.29,0,0,0,3,8.33c.23-.17.45-.29.49-.26a2,2,0,0,1,.22.63A1.31,1.31,0,0,0,4,9.34a5.62,5.62,0,0,0,2.27-.87L7,8l.13.55c.19.74.32.82,1,.65a7.06,7.06,0,0,0,3.46-2.47l.6-.71-.06.64c-.17,1.63-1.3,3.42-3.39,5.42L6.73,14c-3.21,3.06-3,5.59.6,8a46.77,46.77,0,0,0,4.6,2.41c.28.13,1,.52,1.59.87,3.31,2,4.95,3.92,4.95,5.93a2.49,2.49,0,0,0,.07.77h0c.09.09,0,.1.9-.14a2.61,2.61,0,0,0,.83-.32,3.69,3.69,0,0,0-.55-1.83A11.14,11.14,0,0,0,17,26.81a35.7,35.7,0,0,0-5.1-2.91C9.37,22.64,8.38,22,7.52,21.17a3.53,3.53,0,0,1-1.18-2.48c0-1.38.71-2.58,2.5-4.23,2.84-2.6,3.92-3.91,4.67-5.65a3.64,3.64,0,0,0,.42-2A3.37,3.37,0,0,0,13.61,5l-.32-.74.29-.48c.17-.27.37-.63.46-.8l.15-.3.44.64a5.92,5.92,0,0,1,1,2.81,5.86,5.86,0,0,1-.42,1.94c0,.12-.12.3-.15.4a9.49,9.49,0,0,1-.67,1.1,28,28,0,0,1-4,4.29C8.62,15.49,8.05,16.44,8,17.78a3.28,3.28,0,0,0,1.11,2.76c.95,1,2.07,1.74,5.25,3.32,3.64,1.82,5.22,2.9,6.41,4.38A4.78,4.78,0,0,1,21.94,31a3.21,3.21,0,0,0,.14.92,1.06,1.06,0,0,0,.43-.05l.83-.22.46-.12-.06-.46c-.21-1.53-1.62-3.25-3.94-4.8a37.57,37.57,0,0,0-5.22-2.82A13.36,13.36,0,0,1,11,21.19a3.36,3.36,0,0,1-.8-4.19c.41-.85.83-1.31,3.77-4.15,2.39-2.31,3.43-4.13,3.43-6a5.85,5.85,0,0,0-2.08-4.29c-.23-.21-.44-.43-.65-.65A2.5,2.5,0,0,1,15.27.69a10.6,10.6,0,0,1,2.91,2.78A4.16,4.16,0,0,1,19,6.16a4.91,4.91,0,0,1-.87,3c-.71,1.22-1.26,1.82-4.27,4.67a9.47,9.47,0,0,0-2.07,2.6,2.76,2.76,0,0,0-.33,1.54,2.76,2.76,0,0,0,.29,1.47c.57,1.21,2.23,2.55,4.65,3.73a32.41,32.41,0,0,1,5.82,3.24c2.16,1.6,3.2,3.16,3.2,4.8a1.94,1.94,0,0,0,.09.76,4.54,4.54,0,0,0,1.66-.4C27.29,31.42,27.29,31.37,27.14,30.86ZM6.1,7h0a3.77,3.77,0,0,1-1.46.45L4,7.51l.68-.83a25.09,25.09,0,0,0,3-4.82A12,12,0,0,1,8.28.76c.11-.12.77.32,1.53,1l.63.58-.57.84A10.34,10.34,0,0,1,6.1,7Zm5.71-1.78A9.77,9.77,0,0,1,9.24,7.18h0a5.25,5.25,0,0,1-1.17.28l-.58,0,.65-.78a21.29,21.29,0,0,0,2.1-3.12c.22-.41.42-.76.44-.79s.5.43.9,1.24L12,5ZM13.41,3a2.84,2.84,0,0,1-.45.64,11,11,0,0,1-.9-.91l-.84-.9.19-.45c.34-.79.39-.8,1-.31A9.4,9.4,0,0,1,13.8,2.33q-.18.34-.39.69Z" />
</svg>
<h4>Tokenroom Economic System</h4>
</div>
<theme-toggle></theme-toggle>
<button id="user_login_popup_button" onclick="showPopup('sign_in_popup')">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" enable-background="new 0 0 24 24" height="24px"
viewBox="0 0 24 24" width="24px" fill="#000000">
<g>
<rect fill="none" height="24" width="24" />
</g>
<g>
<path
d="M11,7L9.6,8.4l2.6,2.6H2v2h10.2l-2.6,2.6L11,17l5-5L11,7z M20,19h-8v2h8c1.1,0,2-0.9,2-2V5c0-1.1-0.9-2-2-2h-8v2h8V19z" />
</g>
</svg>
</button>
<button id="user_signout_popup_button" class="hide" onclick="showPopup('user_popup')">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M2 12c0-.865.11-1.703.316-2.504A3 3 0 0 0 4.99 4.867a9.99 9.99 0 0 1 4.335-2.505 3 3 0 0 0 5.348 0 9.99 9.99 0 0 1 4.335 2.505 3 3 0 0 0 2.675 4.63c.206.8.316 1.638.316 2.503 0 .865-.11 1.703-.316 2.504a3 3 0 0 0-2.675 4.629 9.99 9.99 0 0 1-4.335 2.505 3 3 0 0 0-5.348 0 9.99 9.99 0 0 1-4.335-2.505 3 3 0 0 0-2.675-4.63C2.11 13.704 2 12.866 2 12zm4.804 3c.63 1.091.81 2.346.564 3.524.408.29.842.541 1.297.75A4.993 4.993 0 0 1 12 18c1.26 0 2.438.471 3.335 1.274.455-.209.889-.46 1.297-.75A4.993 4.993 0 0 1 17.196 15a4.993 4.993 0 0 1 2.77-2.25 8.126 8.126 0 0 0 0-1.5A4.993 4.993 0 0 1 17.195 9a4.993 4.993 0 0 1-.564-3.524 7.989 7.989 0 0 0-1.297-.75A4.993 4.993 0 0 1 12 6a4.993 4.993 0 0 1-3.335-1.274 7.99 7.99 0 0 0-1.297.75A4.993 4.993 0 0 1 6.804 9a4.993 4.993 0 0 1-2.77 2.25 8.126 8.126 0 0 0 0 1.5A4.993 4.993 0 0 1 6.805 15zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
</svg>
</button>
</header>
<nav id="side_nav">
<ul class="nav-list">
<li>
<a href="#dashboard" class="nav-list__item nav-list__item--active interact">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M13 21V11h8v10h-8zM3 13V3h8v10H3zm6-2V5H5v6h4zM3 21v-6h8v6H3zm2-2h4v-2H5v2zm10 0h4v-6h-4v6zM13 3h8v6h-8V3zm2 2v2h4V5h-4z" />
</svg>
<span> dashboard </span>
</a>
</li>
<li id="userinfo-nav" class="hide">
<a href="#userinfo" class="nav-list__item interact">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" height="24px" viewBox="0 0 24 24"
width="24px" fill="#000000">
<path d="M0 0h24v24H0V0z" fill="none"></path>
<path
d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z">
</path>
</svg>
<span> My Tokens </span>
</a>
</li>
<li id="subadmin-nav" class="hide">
<a href="#subadmin" class="nav-list__item interact">
<svg class="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M2 12c0-.865.11-1.703.316-2.504A3 3 0 0 0 4.99 4.867a9.99 9.99 0 0 1 4.335-2.505 3 3 0 0 0 5.348 0 9.99 9.99 0 0 1 4.335 2.505 3 3 0 0 0 2.675 4.63c.206.8.316 1.638.316 2.503 0 .865-.11 1.703-.316 2.504a3 3 0 0 0-2.675 4.629 9.99 9.99 0 0 1-4.335 2.505 3 3 0 0 0-5.348 0 9.99 9.99 0 0 1-4.335-2.505 3 3 0 0 0-2.675-4.63C2.11 13.704 2 12.866 2 12zm4.804 3c.63 1.091.81 2.346.564 3.524.408.29.842.541 1.297.75A4.993 4.993 0 0 1 12 18c1.26 0 2.438.471 3.335 1.274.455-.209.889-.46 1.297-.75A4.993 4.993 0 0 1 17.196 15a4.993 4.993 0 0 1 2.77-2.25 8.126 8.126 0 0 0 0-1.5A4.993 4.993 0 0 1 17.195 9a4.993 4.993 0 0 1-.564-3.524 7.989 7.989 0 0 0-1.297-.75A4.993 4.993 0 0 1 12 6a4.993 4.993 0 0 1-3.335-1.274 7.99 7.99 0 0 0-1.297.75A4.993 4.993 0 0 1 6.804 9a4.993 4.993 0 0 1-2.77 2.25 8.126 8.126 0 0 0 0 1.5A4.993 4.993 0 0 1 6.805 15zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
</svg>
<span> Subadmin </span>
</a>
</li>
</ul>
</nav>
<article class="right language-html">
<section id="dashboard" class="page">
<h2>Get Started</h2>
<table>
<tbody>
<tr>
<td>
<h4>
Production Valuation
</h4>
<p>
Add up all expenses
</p>
<p>
Production valuation is the sum of all the expenses incurred to operate the system.
When tokens are sold the valuation should be atleast equal to cost of operating the
system.
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
Consumption Valuation
</h4>
<p>
Number of room nights consumed * Consumption valuation per night
</p>
<p>
Consumption valuation is the result of valuation the system is building on account
of the basic good or service being offered for consumption. This represents the
gains and earnings from the operation of system.
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
Ownership token
</h4>
<p>
Ownership tokens own the profits of the system
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
Market valuation
</h4>
<p>
Market valuation = Number of ownership token * price per ownership token
</p>
<p>
Market valuation is the future consumption valuation
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
System Valuation
</h4>
<p>
System Valuation = Higher of production valuation and consumption valuation
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
Reserve Pool
</h4>
<p>
Reserve Pool = Market valuation - Production valuation
</p>
<p>
Reserve Pool is a Bitcoin Multisig address which acts as the bank account for this
system. All payments and expenses related to the system will happen there.
</p>
</td>
<td class="stat-value">
</td>
</tr>
<tr>
<td>
<h4>
Investments
</h4>
<p>
</p>
<p>
Investments help in providing for the initial production valuation and they add to
the reserve pool.
</p>
</td>
<td class="stat-value">
</td>
</tr>
</tbody>
</table>
<br>
<div class="grid gap-0-5" id="banner">
<strong> Item being consumed </strong>
<p>
Room nights
</p>
</div>
<br>
<div class="grid gap-0-5" id="banner">
<strong> Reserve tokens </strong>
<p>
Tokens and currency used to keep the system running
</p>
<b id="reserve-tokens-amount">
<sm-spinner></sm-spinner>
</b>
</div>
<br>
<div class="grid gap-0-5" id="banner">
<strong> Number of ownership token </strong>
<p>
Tokenroom#
</p>
<b id="ownership-tokens-amount">
<sm-spinner></sm-spinner>
</b>
</div>
<br>
<div class="grid gap-0-5" id="banner">
<strong> Price per ownership token </strong>
<p>
</p>
<b id="price-per-ownership-token">
<sm-spinner></sm-spinner>
</b>
</div>
<br>
<table>
<tbody>
<tr>
<td>
<h4>
Expenses ( Production valuation)
</h4>
<p>
Includes rent of the property, maintenance, staff salaries, etc.
</p>
<p>
Valuation of all tokens initially is at least equal to the cost incurred.
</p>
</td>
<td id="total-amount-issued" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
Consumption valuation per room night ( Unit of consumption valuation)
</h4>
<p>
The consumption valuation price per room night used to calculate how much system
valuation is being derived from consum
</p>
<p>
Contribution to
</p>
</td>
<td id="price-per-unit-consumption" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
Total room nights stayed
</h4>
<p>
Number of nights people have stayed in the tokenroom
</p>
</td>
<td id="total-consumption-measured" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
Revenue from stays ( Consumption valuation)
</h4>
<p>
Revenue collected from people staying at the tokenroom
</p>
</td>
<td id="consumption-valuation" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
System Valuation
</h4>
<p>
Higher value of the Expenses and Revenue from Stays
</p>
</td>
<td id="system-valuation" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
Market Valuation
</h4>
<p>
Market valuation represents the future consumption valuation of the system
</p>
</td>
<td id="market-valuation" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
<tr>
<td>
<h4>
Investment(committed + delivered) and room revenues (Booked + stayed)
</h4>
<p>
The total money we have either received or got committment for from token sales,
room night investments and on the spot bookings
</p>
</td>
<td id="total-consumption-cost" class="stat-value">
<sm-spinner></sm-spinner>
</td>
</tr>
</tbody>
</table>
<br>
<div class="grid gap-0-5" id="banner">
<strong> Objectives </strong>
<br>
<p>Consumption Valuation should be higher than Production valuation.
Amount to go till Consumption Valuation catches up with production Valuation
</p>
<b id="amount-left-production-consumption-catchup">
<sm-spinner></sm-spinner>
</b>
<br>
<p>Initial token sales should cover up for the production cost at the time of sale
</p>
<br>
<p>Consumption of the service should take care of the running costs
</p>
</div>
</section>
<section id="userinfo" class="page hide">
<h1 class="page__title">My Token Information</h1>
<p>Information of user <span id='userpage-userfloid'></span></p>
<div class="section__header flex align-center space-between" style="padding: 1rem 0;">
<h3>Summary</h3>
<a href="https://ranchimall.github.io/exchange-market/" class="transaction__link flex align-center"
target="_blank" rel="noopener noreferrer">
<svg class="icon margin-right-0-5" xmlns="http://www.w3.org/2000/svg" height="24px"
viewBox="0 0 24 24" width="24px" fill="#000000">
<path d="M0 0h24v24H0z" fill="none" />
<path
d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z" />
</svg>
Trade
</a>
</div>
<div class="card-wrapper">
<div class="card">
<h3>My Token Valuation</h3>
<p id="total-flobnb-valuation"></p>
</div>
<div class="card">
<h3>My Total MINING</h3>
<p id="total-flobnb-balance">-</p>
</div>
<div class="card">
<h3>Price per MINING</h3>
<p id="flobnb-price-userpage">-</p>
</div>
<div class="card">
<h3>My MINING on Exchange</h3>
<p id="exchange-flobnb-balance">-</p>
</div>
<div class="card">
<h3>My MINING on Blockchain</h3>
<p id="blockchain-flobnb-balance">-</p>
</div>
</div>
<div class="section__header">
<div class="grid">
<p></p>
<h3>My Transactions</h3>
<p></p>
</div>
</div>
<div id='user-tx-section' class="card-wrapper">
</div>
</section>
<section id="subadmin" class="page hide">
<h1 class="page__title">Subadmin</h1>
<div class="flex align-center space-between">
<h3>Miners Information</h3>
<sm-button onclick="release_tokens()">Release tokens</sm-button>
</div>
<p></p>
<table>
<thead>
<tr>
<th>FLO ID</th>
<th>Tokens to release</th>
<th>Old tokens</th>
<th>New tokens</th>
<th>Old shares</th>
<th>New shares</th>
</tr>
</thead>
<tbody id="approve_new_users"></tbody>
</table>
</section>
</article>
</main>
<template id="tx-card-1">
<div class="transaction-card card">
<h3 class="txcard-type capitalize"></h3>
<p>
<div class="txcard-amount"></div>
<div class="txcard-split"></div>
<div class="txcard-days-stayed"></div>
<div class="txcard-from-to-date"></div>
</p>
</div>
</template>
<template id="tx-card-2">
<div class="transaction-card card">
<h3 class="txcard-type capitalize"></h3>
<p>
<div class="txcard-split"></div>
<div class="txcard-days-stayed"></div>
<div class="txcard-from-to-date"></div>
</p>
</div>
</template>
<template id="miner_status_entry">
<tr class='miner-status-entry'>
<td class="miner-status-entry-floid"></td>
<td class="tokens-to-release"></td>
<td class="old-tokens"></td>
<td class="new-tokens"></td>
<td class="old-shares"></td>
<td class="new-shares"></td>
<td>
<sm-switch></sm-switch>
</td>
</tr>
</template>
<script src="js/main_UI.js"></script>
<script src="js/components.min.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/floTokenAPI.js"></script>
<script id='ui_utils'>
const slideInLeft = [
{
opacity: 0,
transform: 'translateX(1rem)'
},
{
opacity: 1,
transform: 'translateX(0)'
}
]
const slideOutLeft = [
{
opacity: 1,
transform: 'translateX(0)'
},
{
opacity: 0,
transform: 'translateX(-1rem)'
},
]
const slideInRight = [
{
opacity: 0,
transform: 'translateX(-1rem)'
},
{
opacity: 1,
transform: 'translateX(0)'
}
]
const slideOutRight = [
{
opacity: 1,
transform: 'translateX(0)'
},
{
opacity: 0,
transform: 'translateX(1rem)'
},
]
const slideInDown = [
{
opacity: 0,
transform: 'translateY(-1rem)'
},
{
opacity: 1,
transform: 'translateY(0)'
},
]
const slideInUp = [
{
opacity: 0,
transform: 'translateY(1rem)'
},
{
opacity: 1,
transform: 'translateY(0)'
},
]
const slideOutUp = [
{
opacity: 1,
transform: 'translateY(0)'
},
{
opacity: 0,
transform: 'translateY(-1rem)'
},
]
</script>
<script id="onLoadStartUp">
function formatAmount(amount) {
console.log(`amount: ${amount}`)
return amount.toLocaleString('en-US', { style: 'currency', currency: 'USD' })
}
async function onLoadStartUp() {
//floDapps.addStartUpFunction('Sample', Promised Function)
//floDapps.setAppObjectStores({sampleObs1:{}, sampleObs2:{options{autoIncrement:true, keyPath:'SampleKey'}, Indexes:{sampleIndex:{}}}})
floDapps.setCustomPrivKeyInput(() => new Promise(() => { }))
//floDapps.setAppObjectStores({ images: {} })
//floDapps.setCustomPrivKeyInput(getSignedIn)
//floDapps.setMidStartup(load_overview_data)
//document.getElementById('subadmin-form-submit-button').addEventListener("click", submit_customer_form)
floDapps.setMidStartup(() => {
return new Promise((resolve, reject) => {
console.log('before fetch')
fetch('https://esapi-tokenroom.ranchimall.net/api/economicSystem/data', {
headers: {
'Access-Control-Allow-Origin': '*'
}
})
.then(response => response.json())
.then(data => {
const { productionValuation, consumptionNumber, consumptionCost, consumptionValuation, systemValuation } = data
getRef("total-amount-issued").textContent = formatAmount(productionValuation)
getRef("price-per-unit-consumption").textContent = formatAmount(consumptionValuation / consumptionNumber)
getRef("total-consumption-measured").textContent = consumptionNumber
getRef("total-consumption-cost").textContent = formatAmount(consumptionCost)
getRef("consumption-valuation").textContent = formatAmount(consumptionValuation)
getRef("system-valuation").textContent = formatAmount(systemValuation)
getRef("amount-left-production-consumption-catchup").textContent = formatAmount(Math.max(0, (productionValuation - consumptionValuation)))
resolve()
})
.catch(error => {
console.error('Error:', error)
reject(error)
})
// call api for price per ownership token
smartContractInfo_api = fetch(`${floGlobals.token_api}/api/v2/smartContractInfo?contractName=swap-tokenroom-usd&contractAddress=FUSBi3sQ9YFRs76wiMrDYmhqguPCXue8po`, {
headers: {
'Access-Control-Allow-Origin': '*'
}
})
.then(response => response.json())
.then(data => {
const { price, priceType } = data['contractInfo']
getRef("price-per-ownership-token").textContent = formatAmount(price)
return price
})
.catch(error => {
console.error('Error:', error)
reject(error)
})
tokenInfo_api = fetch(`${floGlobals.token_api}/api/v2/tokenInfo/tokenroom`, {
headers: {
'Access-Control-Allow-Origin': '*'
}
})
.then(response => response.json())
.then(data => {
const { token, tokenSupply } = data
getRef("ownership-tokens-amount").textContent = tokenSupply
return tokenSupply
})
.catch(error => {
console.error('Error:', error)
reject(error)
})
Promise.all([smartContractInfo_api, tokenInfo_api]).then(([price, tokenSupply]) => {
getRef("market-valuation").textContent = formatAmount(price*tokenSupply)
resolve()
});
btcOperator.getBalance('bc1qh38s56q6vqahqv758dgsrvh92tkrt5drg259zklqectmj44uy5lsg4ppps')
.then((btcAddresBalance) => {
console.log(`BTC balance ${btcAddresBalance}`)
getRef("reserve-tokens-amount").textContent = `${btcAddresBalance} BTC`
})
})
})
floDapps.launchStartUp().then((result) => {
console.log(result);
//window.location.hash = '#userinfo';
// getRef('user_flo_id').value = myFloID
// getRef('user_login_popup_button').classList.add('hide')
// getRef('userpage-userfloid').innerText = myFloID
// getRef('user_signout_popup_button').classList.remove('hide')
// Check if subadmin
if (floGlobals.subAdmins.includes(myFloID)) {
console.log('This is a subadmin')
document.getElementById('subadmin-nav').classList.remove('hide')
}
// Show userinfo
//document.getElementById('userinfo-nav').classList.remove('hide')
//document.getElementById('userinfo-nav').click()
//App functions....
}).catch((error) => console.error(error));
}
</script>
<script src="https://ranchimall.github.io/Standard_Operations/lib.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/floCrypto.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/floBlockchainAPI.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/compactIDB.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/floCloudAPI.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/floDapps.js"></script>
<script src="https://ranchimall.github.io/Standard_Operations/btcOperator.js"></script>
</body>
</html>