totrader/totrader/templates/index.html

60 lines
1.6 KiB
HTML

<html>
<head></head>
<body>
<div id="container"></div>
</body>
</html>
<script src="/static/js/react.min.js"></script>
<script src="/static/js/react-dom.min.js"></script>
<script src="/static/js/babel.min.js"></script>
<script type="text/babel">
'use strict';
const e = React.createElement;
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
looping: false
}
}
render() {
return(
<div>
<h1>we trade a lil {{ trade_currency }}</h1>
{
this.state.looping && <p>market making is started</p>
||
<p>market making is paused</p>
}
</div>
)
}
}
// this.setState(prevState => {
// let jasper = { ...prevState.jasper }; // creating copy of state variable jasper
// jasper.name = 'someothername'; // update the name property, assign a new value
// return { jasper }; // return new object jasper object
// });
const domContainer = document.querySelector('#container');
const root = ReactDOM.createRoot(domContainer);
root.render(e(App));
// setInterval(function() {
// fetch('{{ url_for("tasks.store_ticker_data") }}');
// }, 10000)
// store market data - 10s
// update balances - 30s
// update bitcoin price - 120s
// update order status - 30s
// get trade history - 60s
</script>