import fs from "fs"; import {marks} from "./cache.js"; export const chainInfo = JSON.parse(fs.readFileSync('../contract/version.json')).chainInfo console.log('chainInfo', chainInfo) export async function joinChain( socket, chainId ) { try { if (socket.chainId) socket.leave(socket.chainId) socket.join(chainId) socket.chainId = chainId const items = await marks.items(chainId); for (let [token, mark] of items) socket.emit('mark.usd', chainId, token, mark) } catch (e) { console.error('joinChain', e) } }