[{"/home/giulio/dev/gkaching/websrc/src/components/App.tsx":"1","/home/giulio/dev/gkaching/websrc/src/components/Cards.tsx":"2","/home/giulio/dev/gkaching/websrc/src/components/Overlays.tsx":"3","/home/giulio/dev/gkaching/websrc/src/index.tsx":"4"},{"size":4418,"mtime":1609342346604,"results":"5","hashOfConfig":"6"},{"size":5688,"mtime":1609342346604,"results":"7","hashOfConfig":"6"},{"size":5235,"mtime":1609342346604,"results":"8","hashOfConfig":"6"},{"size":371,"mtime":1609358781834,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"12"},"1ev2e5",{"filePath":"13","messages":"14","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"15"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/home/giulio/dev/gkaching/websrc/src/components/App.tsx",["20"],"import React, { Component } from \"react\";\nimport {\n Balance,\n CurrencyPair,\n EventName,\n EventProp,\n FirstConnectMessage,\n NewEventMessage,\n NewTickMessage,\n PositionProp\n} from \"../types\";\nimport { socket } from \"../index\";\nimport { symbolToPair } from \"../utils\";\nimport { Helmet } from \"react-helmet\";\nimport { Navbar, Sidebar } from \"./Navbars\";\nimport { Statusbar } from \"./Statusbar\";\nimport { PositionsTable } from \"./Tables\";\nimport RPlot from \"./RPlot\";\n\ntype AppState = {\n current_price: number,\n current_tick: number,\n last_update: Date,\n positions: Array,\n events: Array,\n active_pair: CurrencyPair,\n available_pairs: Array,\n balances: Array\n}\n\nclass App extends Component<{}, AppState> {\n event_id = 0;\n\n state = {\n current_price: 0,\n current_tick: 0,\n last_update: new Date(),\n positions: [],\n events: [],\n balances: [],\n active_pair: symbolToPair(\"tBTCUSD\"),\n available_pairs: []\n }\n\n constructor(props: {}) {\n super(props)\n }\n\n componentDidMount() {\n socket.on(EventName.FirstConnect, (data: FirstConnectMessage) => {\n this.setState({\n current_price: data.prices[data.prices.length - 1],\n current_tick: data.ticks[data.ticks.length - 1],\n last_update: new Date(),\n positions: data.positions,\n balances: data.balances\n })\n })\n\n socket.on(EventName.NewTick, (data: NewTickMessage) => {\n this.setState({\n current_price: data.price,\n current_tick: data.tick,\n last_update: new Date(),\n positions: data.positions,\n balances: data.balances\n })\n })\n\n socket.on(EventName.NewEvent, (data: NewEventMessage) => {\n // ignore new tick\n if (!data.kind.toLowerCase().includes(\"new_tick\")) {\n const new_event: EventProp = {\n id: this.event_id,\n name: data.kind,\n tick: data.tick\n }\n\n this.event_id += 1\n\n this.setState((state) => ({\n events: [...state.events, new_event]\n }))\n }\n })\n }\n\n render() {\n return (\n <>\n \n Rustico\n - {String(this.state.current_price.toLocaleString())} {String(this.state.active_pair.base) + \"/\" + String(this.state.active_pair.quote)} \n \n
\n
\n \n\n \n
\n \n
\n\n
\n \n \n
\n
\n\n {this.state.positions.length > 0 ?\n : null}\n\n
\n Made with ❤️ by the Peperone in a scantinato\n
\n \n\n \n
\n \n \n )\n }\n}\n\nexport default App;","/home/giulio/dev/gkaching/websrc/src/components/Cards.tsx",["21","22","23","24"],"import React, { Component } from 'react';\nimport { Balance, EventName, FirstConnectMessage, NewTickMessage } from \"../types\";\nimport { socket } from \"../index\";\n\nexport type CoinBalanceProps = {\n name: string,\n amount: number,\n percentage: number,\n quote_equivalent: number,\n quote_symbol: string,\n}\n\nclass CoinBalance extends Component {\n constructor(props: CoinBalanceProps) {\n super(props);\n }\n\n render() {\n // do not print equivalent if this element is the quote itself\n const quoteBlock = this.props.name != this.props.quote_symbol ? this.props.quote_symbol.concat(\" \").concat(this.props.quote_equivalent.toLocaleString()) : null\n\n // const accessory = SymbolAccessories.filter((accessory) => {\n // return accessory.name == this.props.name\n // })\n //\n // const icon = accessory.length > 0 ? accessory.pop().icon : null\n\n return (\n
\n
\n {/*{icon}*/}\n
\n
\n {this.props.name}\n
\n
\n
\n {Math.trunc(this.props.percentage)}%\n
\n
\n
\n
\n
\n
\n
\n
\n {this.props.amount.toFixed(5)} {this.props.name}\n
\n
\n
\n \n {quoteBlock}\n
\n
\n
\n
\n )\n }\n\n}\n\nexport type WalletCardProps = {\n quote: string,\n}\n\nexport class WalletCard extends Component\n <{}, { balances: Array }> {\n // constructor(props) {\n // super(props);\n // }\n\n state =\n {\n balances: []\n }\n\n totalQuoteBalance() {\n let total = 0\n\n this.state.balances.forEach((balance: Balance) => {\n if (balance.currency == balance.quote) {\n total += balance.amount\n } else {\n total += balance.quote_equivalent\n }\n })\n\n return total\n }\n\n renderCoinBalances() {\n return (\n this.state.balances.map((balance: Balance) => {\n const percentage_amount = balance.quote == balance.currency ? balance.amount : balance.quote_equivalent;\n\n return (\n \n )\n })\n )\n }\n\n componentDidMount() {\n socket.on(EventName.NewTick, (data: NewTickMessage) => {\n this.setState({\n balances: data.balances\n })\n })\n\n socket.on(EventName.FirstConnect, (data: FirstConnectMessage) => {\n this.setState({\n balances: data.balances\n })\n })\n }\n\n render() {\n return (\n
\n \n
\n
\n

Your Wallets

\n
\n \n \n
\n
\n
\n\n {this.renderCoinBalances()}\n\n
\n
\n Total Balance ≈ USD {this.totalQuoteBalance().toLocaleString()}\n
\n
\n
\n \n )\n }\n}","/home/giulio/dev/gkaching/websrc/src/components/Overlays.tsx",["25"],"/home/giulio/dev/gkaching/websrc/src/index.tsx",["26"],{"ruleId":"27","severity":1,"message":"28","line":45,"column":5,"nodeType":"29","messageId":"30","endLine":47,"endColumn":6},{"ruleId":"27","severity":1,"message":"28","line":14,"column":5,"nodeType":"29","messageId":"30","endLine":16,"endColumn":6},{"ruleId":"31","severity":1,"message":"32","line":20,"column":44,"nodeType":"33","messageId":"34","endLine":20,"endColumn":46},{"ruleId":"31","severity":1,"message":"35","line":83,"column":34,"nodeType":"33","messageId":"34","endLine":83,"endColumn":36},{"ruleId":"31","severity":1,"message":"35","line":96,"column":57,"nodeType":"33","messageId":"34","endLine":96,"endColumn":59},{"ruleId":"27","severity":1,"message":"28","line":12,"column":5,"nodeType":"29","messageId":"30","endLine":14,"endColumn":6},{"ruleId":"36","severity":1,"message":"37","line":13,"column":7,"nodeType":"38","messageId":"39","endLine":13,"endColumn":9},"@typescript-eslint/no-useless-constructor","Useless constructor.","MethodDefinition","noUselessConstructor","eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","unexpected","Expected '===' and instead saw '=='.","@typescript-eslint/no-unused-vars","'ws' is assigned a value but never used.","Identifier","unusedVar"]