36 lines
738 B
TypeScript
36 lines
738 B
TypeScript
import React from "react";
|
|
import ReactDOM from "react-dom";
|
|
import "bootstrap/dist/css/bootstrap.css";
|
|
import App from "./components/App";
|
|
import io from "socket.io-client";
|
|
|
|
export const socket = io();
|
|
|
|
export type NewTickData = {
|
|
tick: number,
|
|
price: number,
|
|
positions: Array<PositionState>
|
|
}
|
|
|
|
export type PositionState = {
|
|
id: number,
|
|
state: string,
|
|
base_price: number,
|
|
amount: number,
|
|
symbol: string,
|
|
profit_loss: number,
|
|
profit_loss_percentage: number
|
|
}
|
|
|
|
export type PositionCloseMessage = {
|
|
message_name: string,
|
|
position_id: number,
|
|
symbol: string
|
|
}
|
|
|
|
socket.on("connect", function () {
|
|
console.log("Connected!")
|
|
})
|
|
|
|
ReactDOM.render(<App/>, document.getElementById("root"));
|