-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy path.eslintcache
1 lines (1 loc) · 146 KB
/
.eslintcache
1
[{"/home/aki/Documents/Lokian.eth/src/index.tsx":"1","/home/aki/Documents/Lokian.eth/src/AppContainer.tsx":"2","/home/aki/Documents/Lokian.eth/src/App.tsx":"3","/home/aki/Documents/Lokian.eth/src/wallet/hooks.ts":"4","/home/aki/Documents/Lokian.eth/src/Navigation.tsx":"5","/home/aki/Documents/Lokian.eth/src/NavWallet.tsx":"6","/home/aki/Documents/Lokian.eth/src/MenuRoutes.tsx":"7","/home/aki/Documents/Lokian.eth/src/app-functions/index.ts":"8","/home/aki/Documents/Lokian.eth/src/utils/index.ts":"9","/home/aki/Documents/Lokian.eth/src/hooks/index.ts":"10","/home/aki/Documents/Lokian.eth/src/wallet/connectors.ts":"11","/home/aki/Documents/Lokian.eth/src/components/common/index.tsx":"12","/home/aki/Documents/Lokian.eth/src/components/core/Account.tsx":"13","/home/aki/Documents/Lokian.eth/src/components/index.js":"14","/home/aki/Documents/Lokian.eth/src/app-functions/useAddForSale.ts":"15","/home/aki/Documents/Lokian.eth/src/app-functions/useBuyMon.ts":"16","/home/aki/Documents/Lokian.eth/src/app-functions/useRefreshMons.ts":"17","/home/aki/Documents/Lokian.eth/src/app-functions/useRemoveFromSale.ts":"18","/home/aki/Documents/Lokian.eth/src/app-functions/useBreedMons.ts":"19","/home/aki/Documents/Lokian.eth/src/app-functions/useFight.ts":"20","/home/aki/Documents/Lokian.eth/src/app-functions/useBurn.ts":"21","/home/aki/Documents/Lokian.eth/src/app-functions/useBuyItem.ts":"22","/home/aki/Documents/Lokian.eth/src/app-functions/useStartSharing.ts":"23","/home/aki/Documents/Lokian.eth/src/app-functions/useStopSharing.ts":"24","/home/aki/Documents/Lokian.eth/src/utils/approve.ts":"25","/home/aki/Documents/Lokian.eth/src/utils/getAccount.ts":"26","/home/aki/Documents/Lokian.eth/src/utils/txSuccess.ts":"27","/home/aki/Documents/Lokian.eth/src/utils/txFail.ts":"28","/home/aki/Documents/Lokian.eth/src/utils/waitForWsConnection.ts":"29","/home/aki/Documents/Lokian.eth/src/hooks/useContractEvents.ts":"30","/home/aki/Documents/Lokian.eth/src/hooks/useRecognizeConnector.ts":"31","/home/aki/Documents/Lokian.eth/src/hooks/useItemsFromNFT.ts":"32","/home/aki/Documents/Lokian.eth/src/hooks/useTokenBalance.ts":"33","/home/aki/Documents/Lokian.eth/src/utils/getMons.tsx":"34","/home/aki/Documents/Lokian.eth/src/utils/getTokenBalance.tsx":"35","/home/aki/Documents/Lokian.eth/src/components/core/StatBar.tsx":"36","/home/aki/Documents/Lokian.eth/src/utils/toastErrParams.ts":"37","/home/aki/Documents/Lokian.eth/src/components/spinner/index.js":"38","/home/aki/Documents/Lokian.eth/src/components/dojo/index.tsx":"39","/home/aki/Documents/Lokian.eth/src/components/sharedToMe/index.js":"40","/home/aki/Documents/Lokian.eth/src/components/token/index.tsx":"41","/home/aki/Documents/Lokian.eth/src/components/share/index.tsx":"42","/home/aki/Documents/Lokian.eth/src/components/marketplace/index.tsx":"43","/home/aki/Documents/Lokian.eth/src/components/myShop/index.tsx":"44","/home/aki/Documents/Lokian.eth/src/components/myLokiMons/index.tsx":"45","/home/aki/Documents/Lokian.eth/src/components/breed/index.tsx":"46","/home/aki/Documents/Lokian.eth/src/components/arenaSocketIo/index.tsx":"47","/home/aki/Documents/Lokian.eth/src/components/arena/index.tsx":"48","/home/aki/Documents/Lokian.eth/src/components/dojo/mySparringMons.tsx":"49","/home/aki/Documents/Lokian.eth/src/components/common/listRender.js":"50","/home/aki/Documents/Lokian.eth/src/components/common/getMonsOrder.ts":"51","/home/aki/Documents/Lokian.eth/src/components/arena/myFightingMons.tsx":"52","/home/aki/Documents/Lokian.eth/src/components/token/nftItem.tsx":"53","/home/aki/Documents/Lokian.eth/src/components/arena/room.tsx":"54","/home/aki/Documents/Lokian.eth/src/components/common/listIcon.tsx":"55","/home/aki/Documents/Lokian.eth/src/components/common/gridIcon.tsx":"56","/home/aki/Documents/Lokian.eth/src/components/common/genericModal.tsx":"57","/home/aki/Documents/Lokian.eth/src/sprites-copy/index.js":"58","/home/aki/Documents/Lokian.eth/src/ErrorBoundary.tsx":"59"},{"size":265,"mtime":1692909794585,"results":"60","hashOfConfig":"61"},{"size":699,"mtime":1693749334227,"results":"62","hashOfConfig":"61"},{"size":4397,"mtime":1693749892583,"results":"63","hashOfConfig":"61"},{"size":2502,"mtime":1692909794593,"results":"64","hashOfConfig":"61"},{"size":2750,"mtime":1693946490597,"results":"65","hashOfConfig":"61"},{"size":2353,"mtime":1693946214675,"results":"66","hashOfConfig":"61"},{"size":4704,"mtime":1693944069430,"results":"67","hashOfConfig":"61"},{"size":612,"mtime":1692909794561,"results":"68","hashOfConfig":"61"},{"size":391,"mtime":1692909794589,"results":"69","hashOfConfig":"61"},{"size":301,"mtime":1692909794581,"results":"70","hashOfConfig":"61"},{"size":220,"mtime":1692448861515,"results":"71","hashOfConfig":"61"},{"size":8942,"mtime":1692909794573,"results":"72","hashOfConfig":"61"},{"size":311,"mtime":1692909794573,"results":"73","hashOfConfig":"61"},{"size":597,"mtime":1692973094599,"results":"74","hashOfConfig":"61"},{"size":1422,"mtime":1693946537700,"results":"75","hashOfConfig":"61"},{"size":991,"mtime":1693946820422,"results":"76","hashOfConfig":"61"},{"size":1739,"mtime":1694274111956,"results":"77","hashOfConfig":"61"},{"size":1336,"mtime":1694420112934,"results":"78","hashOfConfig":"61"},{"size":1021,"mtime":1693946848498,"results":"79","hashOfConfig":"61"},{"size":1329,"mtime":1694274111908,"results":"80","hashOfConfig":"61"},{"size":1664,"mtime":1693946842178,"results":"81","hashOfConfig":"61"},{"size":1780,"mtime":1693946826770,"results":"82","hashOfConfig":"61"},{"size":1266,"mtime":1692909794561,"results":"83","hashOfConfig":"61"},{"size":1640,"mtime":1692909794561,"results":"84","hashOfConfig":"61"},{"size":844,"mtime":1692909794589,"results":"85","hashOfConfig":"61"},{"size":363,"mtime":1692909794589,"results":"86","hashOfConfig":"61"},{"size":463,"mtime":1692909794589,"results":"87","hashOfConfig":"61"},{"size":433,"mtime":1692909794589,"results":"88","hashOfConfig":"61"},{"size":538,"mtime":1692909794589,"results":"89","hashOfConfig":"61"},{"size":1786,"mtime":1692909794581,"results":"90","hashOfConfig":"61"},{"size":478,"mtime":1692909794585,"results":"91","hashOfConfig":"61"},{"size":1740,"mtime":1692909794585,"results":"92","hashOfConfig":"61"},{"size":779,"mtime":1692909794585,"results":"93","hashOfConfig":"61"},{"size":437,"mtime":1692909794589,"results":"94","hashOfConfig":"61"},{"size":1177,"mtime":1692909794589,"results":"95","hashOfConfig":"61"},{"size":245,"mtime":1692909794573,"results":"96","hashOfConfig":"61"},{"size":106,"mtime":1692909794589,"results":"97","hashOfConfig":"61"},{"size":822,"mtime":1692909794581,"results":"98","hashOfConfig":"61"},{"size":6175,"mtime":1694421553863,"results":"99","hashOfConfig":"61"},{"size":2360,"mtime":1692909794581,"results":"100","hashOfConfig":"61"},{"size":10123,"mtime":1693947131927,"results":"101","hashOfConfig":"61"},{"size":4274,"mtime":1692909794577,"results":"102","hashOfConfig":"61"},{"size":4195,"mtime":1692909794577,"results":"103","hashOfConfig":"61"},{"size":4150,"mtime":1692909794577,"results":"104","hashOfConfig":"61"},{"size":4638,"mtime":1692909794577,"results":"105","hashOfConfig":"61"},{"size":3742,"mtime":1692909794569,"results":"106","hashOfConfig":"61"},{"size":5996,"mtime":1694420919684,"results":"107","hashOfConfig":"61"},{"size":17643,"mtime":1694420919564,"results":"108","hashOfConfig":"61"},{"size":1573,"mtime":1692909794573,"results":"109","hashOfConfig":"61"},{"size":2524,"mtime":1692909794573,"results":"110","hashOfConfig":"61"},{"size":1638,"mtime":1692909794569,"results":"111","hashOfConfig":"61"},{"size":1234,"mtime":1692909794565,"results":"112","hashOfConfig":"61"},{"size":547,"mtime":1692909794581,"results":"113","hashOfConfig":"61"},{"size":13461,"mtime":1694420919616,"results":"114","hashOfConfig":"61"},{"size":642,"mtime":1692909794573,"results":"115","hashOfConfig":"61"},{"size":1051,"mtime":1692909794569,"results":"116","hashOfConfig":"61"},{"size":744,"mtime":1692909794569,"results":"117","hashOfConfig":"61"},{"size":7091,"mtime":1692909794589,"results":"118","hashOfConfig":"61"},{"size":1246,"mtime":1693750794077,"results":"119","hashOfConfig":"61"},{"filePath":"120","messages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},"ndijke",{"filePath":"123","messages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"125","messages":"126","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"127","messages":"128","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"129","usedDeprecatedRules":"122"},{"filePath":"130","messages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"132","messages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"134","messages":"135","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"136","messages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"138","messages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"140","messages":"141","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"142","messages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"144","messages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":19,"fixableErrorCount":0,"fixableWarningCount":0,"source":"146","usedDeprecatedRules":"122"},{"filePath":"147","messages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"149","usedDeprecatedRules":"122"},{"filePath":"150","messages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"152"},{"filePath":"153","messages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"155","messages":"156","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"157","messages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"159","messages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"163","messages":"164","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"165","messages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"167","messages":"168","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"169","messages":"170","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"171","usedDeprecatedRules":"122"},{"filePath":"172","messages":"173","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"174","messages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"176","messages":"177","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"178","messages":"179","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"180","usedDeprecatedRules":"122"},{"filePath":"181","messages":"182","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"183","usedDeprecatedRules":"122"},{"filePath":"184","messages":"185","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"186","usedDeprecatedRules":"122"},{"filePath":"187","messages":"188","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"189","usedDeprecatedRules":"122"},{"filePath":"190","messages":"191","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"192","usedDeprecatedRules":"122"},{"filePath":"193","messages":"194","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"195","usedDeprecatedRules":"122"},{"filePath":"196","messages":"197","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"198","messages":"199","errorCount":0,"fatalErrorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"200","usedDeprecatedRules":"122"},{"filePath":"201","messages":"202","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"203","messages":"204","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"205","usedDeprecatedRules":"122"},{"filePath":"206","messages":"207","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},{"filePath":"208","messages":"209","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"210","usedDeprecatedRules":"152"},{"filePath":"211","messages":"212","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"213"},{"filePath":"214","messages":"215","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"216","usedDeprecatedRules":"152"},{"filePath":"217","messages":"218","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"219","usedDeprecatedRules":"122"},{"filePath":"220","messages":"221","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"222","usedDeprecatedRules":"122"},{"filePath":"223","messages":"224","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"225","usedDeprecatedRules":"122"},{"filePath":"226","messages":"227","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"228","usedDeprecatedRules":"122"},{"filePath":"229","messages":"230","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"231","usedDeprecatedRules":"122"},{"filePath":"232","messages":"233","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"234","usedDeprecatedRules":"122"},{"filePath":"235","messages":"236","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"237"},{"filePath":"238","messages":"239","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"240"},{"filePath":"241","messages":"242","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"243","usedDeprecatedRules":"122"},{"filePath":"244","messages":"245","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"246","usedDeprecatedRules":"152"},{"filePath":"247","messages":"248","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"249","usedDeprecatedRules":"122"},{"filePath":"250","messages":"251","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"252","usedDeprecatedRules":"122"},{"filePath":"253","messages":"254","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"255","usedDeprecatedRules":"122"},{"filePath":"256","messages":"257","errorCount":0,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"258"},{"filePath":"259","messages":"260","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"261","usedDeprecatedRules":"122"},{"filePath":"262","messages":"263","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"264","usedDeprecatedRules":"122"},{"filePath":"265","messages":"266","errorCount":0,"fatalErrorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"267","usedDeprecatedRules":"122"},{"filePath":"268","messages":"269","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"152"},{"filePath":"270","messages":"271","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"122"},"/home/aki/Documents/Lokian.eth/src/index.tsx",[],[],"/home/aki/Documents/Lokian.eth/src/AppContainer.tsx",[],"/home/aki/Documents/Lokian.eth/src/App.tsx",[],"/home/aki/Documents/Lokian.eth/src/wallet/hooks.ts",["272","273","274"],"import { useState, useEffect } from 'react'\nimport { useWeb3React } from '@web3-react/core'\n\nimport { injected } from './connectors'\n\nexport function useEagerConnect() {\n const { activate, active } = useWeb3React()\n \n const [tried, setTried] = useState(false)\n \n useEffect(() => {\n injected.isAuthorized().then((isAuthorized: boolean) => {\n if (isAuthorized) {\n activate(injected, undefined, true).catch(() => {\n setTried(true)\n })\n } else {\n setTried(true)\n }\n })\n }, []) // intentionally only running on mount (make sure it's only mounted once :))\n \n // if the connection worked, wait until we get confirmation of that to flip the flag\n useEffect(() => {\n if (!tried && active) {\n setTried(true)\n }\n }, [tried, active])\n \n return tried\n }\n\n export function useInactiveListener(suppress = false) {\n const { active, error, activate } = useWeb3React()\n \n useEffect(() => {\n const { ethereum } = window as any\n if (ethereum && ethereum.on && !active && !error && !suppress) {\n const handleConnect = () => {\n console.log(\"Handling 'connect' event\")\n activate(injected)\n }\n const handleChainChanged = (chainId: string | number) => {\n console.log(\"Handling 'chainChanged' event with payload\", chainId)\n activate(injected)\n }\n const handleAccountsChanged = (accounts: string[]) => {\n console.log(\"Handling 'accountsChanged' event with payload\", accounts)\n if (accounts.length > 0) {\n activate(injected)\n }\n }\n const handleNetworkChanged = (networkId: string | number) => {\n console.log(\"Handling 'networkChanged' event with payload\", networkId)\n activate(injected)\n }\n \n ethereum.on('connect', handleConnect)\n ethereum.on('chainChanged', handleChainChanged)\n ethereum.on('accountsChanged', handleAccountsChanged)\n ethereum.on('networkChanged', handleNetworkChanged)\n \n return () => {\n if (ethereum.removeListener) {\n ethereum.removeListener('connect', handleConnect)\n ethereum.removeListener('chainChanged', handleChainChanged)\n ethereum.removeListener('accountsChanged', handleAccountsChanged)\n ethereum.removeListener('networkChanged', handleNetworkChanged)\n }\n }\n }\n }, [active, error, suppress, activate])\n }","/home/aki/Documents/Lokian.eth/src/Navigation.tsx",[],"/home/aki/Documents/Lokian.eth/src/NavWallet.tsx",[],"/home/aki/Documents/Lokian.eth/src/MenuRoutes.tsx",[],"/home/aki/Documents/Lokian.eth/src/app-functions/index.ts",[],"/home/aki/Documents/Lokian.eth/src/utils/index.ts",[],"/home/aki/Documents/Lokian.eth/src/hooks/index.ts",[],"/home/aki/Documents/Lokian.eth/src/wallet/connectors.ts",[],"/home/aki/Documents/Lokian.eth/src/components/common/index.tsx",["275","276","277","278","279","280","281","282","283","284","285","286","287","288","289","290","291","292","293"],"// Load all the background images for the 10 different Cryptomon types\r\nimport bg0 from '../../sprites-copy/background/0.png'\r\nimport bg1 from '../../sprites-copy/background/1.png'\r\nimport bg2 from '../../sprites-copy/background/2.png'\r\nimport bg3 from '../../sprites-copy/background/3.png'\r\nimport bg4 from '../../sprites-copy/background/4.png'\r\nimport bg5 from '../../sprites-copy/background/5.png'\r\nimport bg6 from '../../sprites-copy/background/6.png'\r\nimport bg7 from '../../sprites-copy/background/7.png'\r\nimport bg8 from '../../sprites-copy/background/8.png'\r\nimport bg9 from '../../sprites-copy/background/9.png'\r\nimport bg10 from '../../sprites-copy/background/10.png'\r\n\r\nimport MonImages from '../../sprites-copy'\r\nimport StatBar from '../core/StatBar'\r\nimport Spinner from '../spinner'\r\nimport { formatUnits } from '@ethersproject/units'\r\nimport React from 'react'\r\nimport { Lokimon } from '../../models'\r\nimport './common.css'\r\nimport { BigNumber } from 'ethers'\r\n\r\n// Add all 151 Cryptomon names in an array\r\nexport const names = [\r\n 'Dryad',\r\n 'Hamadryad',\r\n 'Leshy',\r\n 'Santelmo',\r\n 'Cerberus',\r\n 'Efreet',\r\n 'Fastitocalon',\r\n 'Aspidochelone',\r\n 'Zaratan',\r\n 'Arachne',\r\n 'Jorogumo',\r\n 'Tsuchigumo',\r\n 'Pabilsag',\r\n 'Girtablilu',\r\n 'Selket',\r\n 'Tsikavats',\r\n 'Munnin',\r\n 'Huginn',\r\n 'Azeban',\r\n 'Ratatoskr',\r\n 'Stratim',\r\n 'Navka',\r\n 'Apep',\r\n 'Nidhoggr',\r\n 'Raiju',\r\n 'Raijin',\r\n 'Amphivena',\r\n 'Basilisk',\r\n 'Wolpertinger',\r\n 'Ramidreju',\r\n 'Echinemon',\r\n 'Mujina',\r\n 'Kamaitachi',\r\n 'Lavellan',\r\n 'Vila',\r\n 'Huldra',\r\n 'Chimera',\r\n 'Kyuubi',\r\n 'Nixie',\r\n 'Tuathan',\r\n 'Minyades',\r\n 'Camazotz',\r\n 'Curupira',\r\n 'Penghou',\r\n 'Ghillie_Dhu',\r\n 'Myrmecoleon',\r\n 'Myrmidon',\r\n 'Mothman',\r\n 'Moth_King',\r\n 'Grootslang',\r\n 'Yaoguai',\r\n 'Cait_Sidhe',\r\n 'Cath_Balug',\r\n 'Nakki',\r\n 'Kappa',\r\n 'Satori',\r\n 'Shojo',\r\n 'Skohl',\r\n 'Haet',\r\n 'Vodyanoy',\r\n 'Undine',\r\n 'Melusine',\r\n 'Vukodlak',\r\n 'Chernobog',\r\n 'Djinn',\r\n 'Bauk',\r\n 'Troll',\r\n 'Jotun',\r\n 'Spriggan',\r\n 'Jubokko',\r\n 'Kodama',\r\n 'Bukavak',\r\n 'Kraken',\r\n 'Clayboy',\r\n 'Met',\r\n 'Emet',\r\n 'Sleipnir',\r\n 'Todorats',\r\n 'Scylla',\r\n 'Charybdis',\r\n 'Brontes',\r\n 'Arges',\r\n 'Hraesvelgr',\r\n 'Berunda',\r\n 'Cockatrice',\r\n 'Selkie',\r\n 'Rusalka',\r\n 'Tarasque',\r\n 'Meretseger',\r\n 'Carbuncle',\r\n 'Shen',\r\n 'Boogeyman',\r\n 'Banshee',\r\n 'Mare',\r\n 'Dilong',\r\n 'Incubus',\r\n 'Succubus',\r\n 'Cancer',\r\n 'Karkinos',\r\n 'Druk',\r\n 'Shenlong',\r\n 'Gan_Ceann',\r\n 'Oni',\r\n 'Tairanohone',\r\n 'Gashadokuro',\r\n 'Yeren',\r\n 'Yeti',\r\n 'Yowie',\r\n 'Nezhit',\r\n 'Chuma',\r\n 'Sigbin',\r\n 'Gargoyle',\r\n 'Caladrius',\r\n 'Umibozu',\r\n 'Callisto',\r\n 'Kelpie',\r\n 'Makara',\r\n 'Morgen',\r\n 'Merrow',\r\n 'Naiad',\r\n 'Nereid',\r\n 'Pixiu',\r\n 'Khepri',\r\n 'Likho',\r\n 'kitsune',\r\n 'Caorthannach',\r\n 'Kaggen',\r\n 'Audumbla',\r\n 'Lochness',\r\n 'Jormungandr',\r\n 'Leviathan',\r\n 'Doppelganger',\r\n 'Skvader',\r\n 'Fossegrim',\r\n 'Valkyrie',\r\n 'Basan',\r\n 'Tsukumogami',\r\n 'Luska',\r\n 'Hydra',\r\n 'Afanc',\r\n 'Cetus',\r\n 'Vedfolnir',\r\n 'Baku',\r\n 'Alkonost',\r\n 'Quetzalcoatl',\r\n 'Anzu',\r\n 'Zmey',\r\n 'Azhdaya',\r\n 'Fafnir',\r\n 'Baba_Yaga',\r\n 'Baba_Roga',\r\n]\r\n\r\n// Add background images in an array for easy access\r\nconst bg = [bg0, bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8, bg9, bg10]\r\n\r\nexport const monName = (specie: number) => names[specie]\r\n\r\nexport const nameDiv = (mon: Lokimon) => {\r\n return (\r\n <div>\r\n <label className=\"monName\">{names[mon?.species]}</label>\r\n <label className=\"\" style={{ float: 'right' }}>\r\n {'#' + mon?.id}\r\n </label>\r\n </div>\r\n )\r\n}\r\n\r\n// Function that returns the style of the background image according to Cryptomons' type\r\nexport const bgStyle = (Type) => ({\r\n backgroundImage: 'url(' + bg[Type] + ')',\r\n backgroundSize: '210px 240px',\r\n})\r\n\r\n// div that holds the images (Cryptomon image and background image) of a Cryptomon\r\nexport const imgDiv = (mon: Lokimon) => {\r\n return (\r\n <div className=\"monBox monBox-320-scrn\" style={bgStyle(mon?.monType)}>\r\n <img\r\n className=\"monImg\"\r\n src={MonImages[`${parseInt(mon?.species?.toString()) + 1}`]}\r\n alt={mon?.species?.toString()}\r\n height=\"32\"\r\n width=\"32\"\r\n />\r\n </div>\r\n )\r\n}\r\n\r\n// div that holds the stats of a Cryptomon\r\nexport const statDiv = (mon: Lokimon) => {\r\n return (\r\n <div className=\"stat-area\">\r\n <div className=\"stat-line\">\r\n <label className=\"stat-label\">Hp: </label>\r\n <StatBar percentage={(mon?.hp * 100) / 160} />\r\n </div>\r\n <div className=\"stat-line\">\r\n <label className=\"stat-label\">Attack: </label>\r\n <StatBar percentage={(mon?.atk * 100) / 160} />\r\n </div>\r\n <div className=\"stat-line\">\r\n <label className=\"stat-label\">Defense: </label>\r\n <StatBar percentage={(mon?.def * 100) / 160} />\r\n </div>\r\n <div className=\"stat-line\">\r\n <label className=\"stat-label\">Speed: </label>\r\n <StatBar percentage={(mon?.speed * 100) / 160} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\n// Create the div with add for sale button\r\nexport const addForSaleDiv = (mon: Lokimon, price: number, handleChangePrice, isAddForSaleLoading, addForSale) => {\r\n return (\r\n <div className=\"selling-div\">\r\n <label className=\"add-for-sale-label\">Set lokimons price:</label>\r\n <input type=\"number\" className=\"add-for-sale-input\" onChange={(e) => handleChangePrice(e)} />\r\n {isAddForSaleLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button className=\"rpgui-button\" type=\"button\" onClick={() => addForSale(mon?.id, price)}>\r\n Sell\r\n </button>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\n// Create the div with remove from sale button\r\nexport const removeFromSaleDiv = (mon: Lokimon, isRemoveFromSaleLoading: boolean, removeFromSale) => {\r\n return (\r\n <div className=\"selling-div\">\r\n <label className=\"remove-from-sale-label\">\r\n Price:\r\n <br />\r\n {formatUnits(BigNumber.from(mon?.price))}\r\n </label>\r\n {isRemoveFromSaleLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button className=\"rpgui-button\" type=\"button\" onClick={() => removeFromSale(mon?.id)}>\r\n Delist\r\n {isRemoveFromSaleLoading && <Spinner color=\"#000\" />}\r\n </button>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\n// Create the div with buy button\r\nexport const buyDiv = (mon: Lokimon, isBuyMonLoading, buyMon) => {\r\n return (\r\n <div className=\"buying-div\">\r\n <div className=\"sale-price\">\r\n Price:\r\n <br />\r\n {formatUnits(mon?.price, 18)}\r\n </div>\r\n <div className=\"sale-owner\">Creature Owner: {mon?.owner} </div>\r\n {isBuyMonLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button\r\n className=\"sale-btn rpgui-button\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => buyMon(mon?.id, mon?.price)}\r\n >\r\n Buy\r\n </button>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\n// Create the div with breed choice 1, choice 2 buttons\r\nexport const breedDiv = (mon: Lokimon, setBreedChoice1Func, setBreedChoice2Func) => {\r\n return (\r\n <div className=\"breed-choice-div\">\r\n <button\r\n className=\"br-Choice-btn rpgui-button\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => {\r\n setBreedChoice1Func(mon?.id)\r\n }}\r\n >\r\n Choice 1\r\n </button>\r\n <button\r\n className=\"br-Choice-btn rpgui-button\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => {\r\n setBreedChoice2Func(mon?.id)\r\n }}\r\n >\r\n Choice 2\r\n </button>\r\n </div>\r\n )\r\n}\r\n\r\nexport const breedOption = (breedchoice: number, lokimons = []) => {\r\n if (breedchoice === null) {\r\n return (\r\n <div className=\"mon mon-320-scrn\">\r\n <figure className=\"my-figure my-figure-320-scrn\">\r\n <figcaption>\r\n <div className=\"monBox monBox-320-scrn\">\r\n {' '}\r\n <img className=\"monImg\" src={MonImages['0']} alt={'empty'} />\r\n </div>\r\n </figcaption>\r\n </figure>\r\n </div>\r\n )\r\n } else {\r\n return lokimons\r\n .filter((mon) => mon.id === breedchoice)\r\n .map((mon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon mon-320-scrn\">\r\n <figure className=\"my-figure my-figure-320-scrn\">\r\n {imgDiv(mon)}\r\n <figcaption></figcaption>\r\n </figure>\r\n </div>\r\n </React.Fragment>\r\n ))\r\n }\r\n}\r\n","/home/aki/Documents/Lokian.eth/src/components/core/Account.tsx",["294"],"import React from 'react'\r\nimport { useWeb3React } from '@web3-react/core'\r\n\r\nexport function Account() {\r\n const { account } = useWeb3React()\r\n return (\r\n <span>\r\n {account === null ? '-' : account ? `${account.substring(0, 6)}...${account.substring(account.length - 4)}` : ''}\r\n </span>\r\n )\r\n}\r\n","/home/aki/Documents/Lokian.eth/src/components/index.js",[],[],"/home/aki/Documents/Lokian.eth/src/app-functions/useAddForSale.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useBuyMon.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useRefreshMons.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useRemoveFromSale.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useBreedMons.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useFight.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useBurn.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useBuyItem.ts",[],"/home/aki/Documents/Lokian.eth/src/app-functions/useStartSharing.ts",["295"],"import { Web3Provider } from '@ethersproject/providers'\r\nimport { toast } from 'react-toastify'\r\nimport { toastErrParams } from '../utils/toastErrParams'\r\nimport { Contract } from '@ethersproject/contracts'\r\nimport contrInterface from '../abis/interface.json'\r\nimport { CONTRACT_ADDRESS } from '../App'\r\n\r\nconst useStartSharing = (\r\n library: Web3Provider,\r\n account: string,\r\n setIsShareLoading: React.Dispatch<React.SetStateAction<boolean>>,\r\n refreshMons: () => void\r\n) => {\r\n const startSharing = async (id: number, address: string) => {\r\n setIsShareLoading(true)\r\n const contr = new Contract(CONTRACT_ADDRESS, contrInterface, library.getSigner(account))\r\n const overrides = {\r\n gasLimit: 120000,\r\n }\r\n const tx = await contr.startSharing(id, address, overrides).catch(() => setIsShareLoading(false))\r\n const recpt = await tx?.wait()\r\n if (recpt && recpt.status) {\r\n toast.success(`Success, Tx hash: ${recpt.transactionHash}`, toastErrParams)\r\n refreshMons()\r\n setIsShareLoading(false)\r\n }\r\n if (recpt && !recpt.status) {\r\n toast.error(`Error, Tx hash: ${recpt.transactionHash}`, toastErrParams)\r\n setIsShareLoading(false)\r\n }\r\n }\r\n return { startSharing }\r\n}\r\n\r\nexport default useStartSharing\r\n","/home/aki/Documents/Lokian.eth/src/app-functions/useStopSharing.ts",[],"/home/aki/Documents/Lokian.eth/src/utils/approve.ts",[],"/home/aki/Documents/Lokian.eth/src/utils/getAccount.ts",[],"/home/aki/Documents/Lokian.eth/src/utils/txSuccess.ts",["296","297","298","299"],"import { toastErrParams } from \"./toastErrParams\";\n\nfunction txSuccess(recpt, toastFunc, refreshMonFunc, isLoadingFunc=null) {\n if (!recpt) return\n\n if (recpt.status === 1) {\n toastFunc\n ? toastFunc.success(`Success, Tx hash: ${recpt.transactionHash}`, toastErrParams)\n : console.log(`Success, Tx hash: ${recpt.transactionHash}`)\n if (refreshMonFunc) refreshMonFunc()\n if (isLoadingFunc) isLoadingFunc(false)\n }\n}\n\nexport default txSuccess;\n","/home/aki/Documents/Lokian.eth/src/utils/txFail.ts",["300","301","302"],"import { toastErrParams } from \"./toastErrParams\";\n\nfunction txFail(recpt, toastFunc, isLoadingFunc=null) {\n if (!recpt) return\n \n if (recpt.status === 0) {\n toastFunc\n ? toastFunc.error(`Error, Tx hash: ${recpt.transactionHash}`, toastErrParams)\n : console.log(`Error, Tx hash: ${recpt.transactionHash}`)\n if (isLoadingFunc) {\n isLoadingFunc(false)\n }\n }\n }\n \n export default txFail;","/home/aki/Documents/Lokian.eth/src/utils/waitForWsConnection.ts",["303"],"/**\r\n * Recursively wait for websocket connection\r\n *\r\n * @param {WebSocket} ws\r\n * @param {any} callback\r\n * @param {number} interval\r\n * @return {void}\r\n */\r\n\r\n\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconst waitForWsConnection = (ws: WebSocket, callback: any, interval: number): void => {\r\n if (ws?.readyState === 1) {\r\n if (callback) callback()\r\n } else {\r\n setTimeout(function () {\r\n waitForWsConnection(ws, callback, interval)\r\n }, interval)\r\n }\r\n}\r\n\r\nexport default waitForWsConnection\r\n","/home/aki/Documents/Lokian.eth/src/hooks/useContractEvents.ts",["304","305"],"import { useEffect, useState } from 'react'\r\nimport { Contract } from '@ethersproject/contracts'\r\nimport contrInterface from '../abis/interface.json'\r\nimport { CONTRACT_ADDRESS } from '../App'\r\nimport { BigNumber } from 'ethers'\r\n\r\nconst useContractEvents = ({ fightTxDone, library, account, refreshMons, setDisableFightBtn }) => {\r\n const [rewards, setRewards] = useState(0)\r\n const [winner, setWinner] = useState(null)\r\n const [rounds, setRounds] = useState(null)\r\n\r\n useEffect(() => {\r\n if (!library || !account) {\r\n return\r\n }\r\n\r\n let mounted = true\r\n\r\n const contr = new Contract(CONTRACT_ADDRESS, contrInterface, library.getSigner(account))\r\n\r\n contr.on('FightResults', (_winnerId, _round) => {\r\n if (mounted) {\r\n const winId = BigNumber.from(_winnerId._hex).toNumber()\r\n const round = BigNumber.from(_round._hex).toNumber()\r\n setWinner(winId)\r\n setRounds(round)\r\n refreshMons()\r\n setDisableFightBtn(false)\r\n }\r\n })\r\n\r\n contr.on('Rewards', (_winnerId, _rewards) => {\r\n if (mounted) {\r\n const rewards = BigNumber.from(_rewards._hex).toNumber()\r\n setRewards(rewards)\r\n refreshMons()\r\n setDisableFightBtn(false)\r\n console.log('rewards winner', _winnerId);\r\n \r\n }\r\n })\r\n\r\n return () => {\r\n contr.off('FightResults', (_winnerId, _round) => {\r\n setDisableFightBtn(false)\r\n console.log(_winnerId, _round);\r\n })\r\n contr.off('Rewards', (_winnerId, _round) => {\r\n setDisableFightBtn(false)\r\n console.log(_winnerId, _round);\r\n })\r\n\r\n mounted = false\r\n }\r\n }, [fightTxDone, library, account])\r\n\r\n return { winner, rounds, rewards, setWinner, setRounds }\r\n}\r\n\r\nexport default useContractEvents\r\n","/home/aki/Documents/Lokian.eth/src/hooks/useRecognizeConnector.ts",["306","307"],"import { useState, useEffect } from 'react'\r\n\r\nconst useRecognizeConnector = ({ connector, refreshMons }) => {\r\n const [activatingConnector, setActivatingConnector] = useState()\r\n useEffect(() => {\r\n if (activatingConnector && activatingConnector === connector) {\r\n setActivatingConnector(undefined)\r\n }\r\n refreshMons()\r\n }, [activatingConnector, connector])\r\n return { activatingConnector, setActivatingConnector }\r\n}\r\n\r\nexport default useRecognizeConnector\r\n","/home/aki/Documents/Lokian.eth/src/hooks/useItemsFromNFT.ts",["308","309"],"import { Contract } from '@ethersproject/contracts'\r\nimport { BigNumber } from 'ethers'\r\nimport { useEffect, useState } from 'react'\r\nimport nftInterface from '../abis/project.nft.abi.json'\r\nimport { ERC1155_CONTRACT_ADDRESS } from '../App'\r\n\r\nconst useItemsFromNFT = ({ library, account, disableBuyItemBtn }) => {\r\n const [healingPotions, setHealingPotions] = useState(null)\r\n const [manaPotions, setManaPotions] = useState(null)\r\n const [magicPotions, setMagicPotions] = useState(null)\r\n const [swords, setSwords] = useState(null)\r\n const [shields, setShields] = useState(null)\r\n\r\n useEffect(() => {\r\n if (!library || !account) {\r\n return\r\n }\r\n\r\n let mounted = true\r\n\r\n ;(async function () {\r\n if (mounted) {\r\n const nftContr = new Contract(ERC1155_CONTRACT_ADDRESS, nftInterface, library.getSigner(account))\r\n const healpot = await nftContr.balanceOf(account, 0)\r\n const manapot = await nftContr.balanceOf(account, 1)\r\n const magicpot = await nftContr.balanceOf(account, 2)\r\n const _swords = await nftContr.balanceOf(account, 3)\r\n const _shields = await nftContr.balanceOf(account, 4)\r\n\r\n setHealingPotions(BigNumber.from(healpot._hex).toBigInt())\r\n setManaPotions(BigNumber.from(manapot._hex).toBigInt())\r\n setMagicPotions(BigNumber.from(magicpot._hex).toBigInt())\r\n setSwords(BigNumber.from(_swords._hex).toBigInt())\r\n setShields(BigNumber.from(_shields._hex).toBigInt())\r\n }\r\n })()\r\n\r\n return () => {\r\n mounted = false\r\n }\r\n }, [library, account, disableBuyItemBtn])\r\n\r\n return {\r\n healingPotions,\r\n magicPotions,\r\n manaPotions,\r\n swords,\r\n shields,\r\n }\r\n}\r\n\r\nexport default useItemsFromNFT\r\n","/home/aki/Documents/Lokian.eth/src/hooks/useTokenBalance.ts",[],"/home/aki/Documents/Lokian.eth/src/utils/getMons.tsx",["310","311","312"],"import { Contract } from '@ethersproject/contracts'\r\nimport contrInterface from '../abis/interface.json' \r\nimport { CONTRACT_ADDRESS } from '../App'\r\n\r\nexport async function getMons(_library, _account) {\r\n const contr = new Contract(CONTRACT_ADDRESS, contrInterface, _library.getSigner(_account))\r\n const totalMons = parseInt(await contr.totalMons())\r\n return Promise.all([...Array(totalMons).keys()].map((id) => contr.mons(id)))\r\n}\r\n","/home/aki/Documents/Lokian.eth/src/utils/getTokenBalance.tsx",[],"/home/aki/Documents/Lokian.eth/src/components/core/StatBar.tsx",["313","314"],"import React from 'react';\nimport './StatBar.css';\n\nfunction StatBar({ percentage }) {\n return (\n <div className=\"box\">\n <div className=\"filler\" style={{ width: `${percentage}%` }} />\n </div>\n )\n}\n\nexport default StatBar;\n","/home/aki/Documents/Lokian.eth/src/utils/toastErrParams.ts",[],"/home/aki/Documents/Lokian.eth/src/components/spinner/index.js",["315","316"],"import React from 'react'\r\n\r\n// <!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->\r\nconst Spinner = ({ color, ...rest }) => {\r\n return (\r\n <svg width=\"38\" height=\"38\" viewBox=\"0 0 38 38\" xmlns=\"http://www.w3.org/2000/svg\" stroke={color} {...rest}>\r\n <g fill=\"none\" fillRule=\"evenodd\">\r\n <g transform=\"translate(1 1)\" strokeWidth=\"2\">\r\n <circle strokeOpacity=\".5\" cx=\"18\" cy=\"18\" r=\"18\" />\r\n <path d=\"M36 18c0-9.94-8.06-18-18-18\">\r\n <animateTransform\r\n attributeName=\"transform\"\r\n type=\"rotate\"\r\n from=\"0 18 18\"\r\n to=\"360 18 18\"\r\n dur=\"1s\"\r\n repeatCount=\"indefinite\"\r\n />\r\n </path>\r\n </g>\r\n </g>\r\n </svg>\r\n )\r\n}\r\n\r\n\r\nexport default Spinner","/home/aki/Documents/Lokian.eth/src/components/dojo/index.tsx",["317"],"import React, { useEffect, useState } from 'react'\r\nimport { Container, Row, Col, Table } from 'react-bootstrap'\r\nimport { Lokimon } from '../../models'\r\nimport { breedOption } from '../common'\r\nimport Spinner from '../spinner'\r\nimport './dojo.css'\r\nimport MySparringMons from './mySparringMons'\r\n\r\ninterface Params {\r\n fightChoice1: string\r\n fightChoice2: string\r\n cryptomons: Lokimon[]\r\n winner: number\r\n monNames: string[]\r\n fightTxDone: boolean\r\n rewards: number\r\n rounds: number\r\n disableFightBtn: boolean\r\n fight: (fightChoice1: number, fightChoice2: number) => void\r\n account: string\r\n myCryptomons: Lokimon[]\r\n otherCryptomons: Lokimon[]\r\n setFightChoice1Func: React.Dispatch<string>\r\n setFightChoice2Func: React.Dispatch<string>\r\n}\r\n\r\nconst Dojo = (params: Params) => {\r\n const [matchWinner, setMatchWinner] = useState('')\r\n const [winnerID, setWinnerID] = useState('')\r\n const [matches, setMatches] = useState(0)\r\n const [rewardAmount, setRewardAmount] = useState(0)\r\n\r\n useEffect(() => {\r\n if (!params || !params.fight || !params.fightTxDone) return\r\n if (!params.winner || !params.cryptomons || !params.monNames) return\r\n\r\n const tie = params.winner == 12345678911 || params.winner == 12345678910\r\n const winnerMon = params.cryptomons.find((mon) => mon.id === params.winner)\r\n\r\n if (tie) {\r\n setMatchWinner('Tie')\r\n } else {\r\n setMatchWinner(params.monNames[winnerMon.species] ?? 'Tie')\r\n setWinnerID(params.winner.toString())\r\n setMatches(params?.rounds)\r\n if (params.rewards) setRewardAmount(params.rewards)\r\n }\r\n }, [params, params?.fightTxDone])\r\n\r\n return (\r\n <>\r\n <div className=\"p1-dojo green-glow\">Dojo</div>\r\n\r\n <div className=\"rpgui-container framed-grey vs-container\" style={{ marginTop: '24px' }}>\r\n <Container fluid>\r\n <Row>\r\n <Col xs=\"12\" lg=\"12\" className=\"col-text-center\">\r\n <span>\r\n {\r\n params.monNames[\r\n params.cryptomons.find((mon) => mon.id?.toString() === params.fightChoice1?.toString())?.species\r\n ]\r\n }{' '}\r\n {params?.fightChoice1 ? `no.${params.fightChoice1}` : params?.fightChoice1 == '0' ? `no.${0}` : ''}\r\n </span>\r\n </Col>\r\n <Col xs md=\"12\" className=\"col-text-center\">\r\n VS\r\n </Col>\r\n <Col xs=\"12\" lg=\"12\" className=\"col-text-center\">\r\n <span>\r\n {\r\n params.monNames[\r\n params.cryptomons.find((mon) => mon.id?.toString() === params?.fightChoice2?.toString())?.species\r\n ]\r\n }{' '}\r\n {params?.fightChoice2 ? `no.${params?.fightChoice2}` : ''}\r\n </span>\r\n </Col>\r\n </Row>\r\n </Container>\r\n </div>\r\n <div className=\"fighting-area\" style={{ marginTop: '9px' }}>\r\n <div className='dojo-spar-mons-img'>\r\n {breedOption(parseInt(params?.fightChoice1), params.cryptomons)}\r\n {breedOption(parseInt(params?.fightChoice2), params.cryptomons)}\r\n </div>\r\n\r\n <div>\r\n <Table striped bordered hover variant=\"dark\" responsive style={{ marginTop: '8px' }} className='dojo-results-table'>\r\n <thead>\r\n <tr>\r\n <th>Winner</th>\r\n <th>No.</th>\r\n <th>Rounds</th>\r\n <th>Rewards</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <td>{matchWinner}</td>\r\n <td>{winnerID}</td>\r\n <td>{matches}</td>\r\n <td>{rewardAmount}</td>\r\n </tr>\r\n </tbody>\r\n </Table>\r\n </div>\r\n\r\n <div style={{marginBottom:'12px'}}>\r\n {params?.disableFightBtn ? (\r\n <Spinner color=\"gray\" style={{ marginLeft: '50%', marginRight: 'auto', padding: '8px' }} />\r\n ) : (\r\n <button\r\n style={{ width: '100%' }}\r\n id=\"fight-btn\"\r\n className=\"rpgui-button\"\r\n type=\"button\"\r\n onClick={() => {\r\n setMatchWinner('')\r\n setWinnerID('')\r\n setMatches(0)\r\n setRewardAmount(0)\r\n params.fight(parseInt(params?.fightChoice1) || null, parseInt(params?.fightChoice2) || null)\r\n }}\r\n disabled={params?.disableFightBtn || (params.fightChoice1 === '' || params.fightChoice2 === '')\r\n || (!params.fightChoice1 || !params.fightChoice2)}\r\n >\r\n Fight!\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n\r\n {/* fight mons area, fight against area */}\r\n <div className=\"rpgui-container framed-grey table-container\">\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Select LokiMon</div>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col xs md={12}>\r\n <div className=\"dojo-selection\">\r\n <MySparringMons\r\n mons={params?.myCryptomons}\r\n setFightChoiceFunc={params?.setFightChoice1Func}\r\n account={params?.account}\r\n choice=\"1\"\r\n />\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n\r\n <div className=\"rpgui-container framed-grey table-container\">\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Select Opponent</div>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col xs md={12}>\r\n <div className=\"dojo-selection\">\r\n <MySparringMons\r\n mons={params?.otherCryptomons}\r\n setFightChoiceFunc={params?.setFightChoice2Func}\r\n account={params?.account}\r\n choice=\"2\"\r\n />\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nexport default Dojo\r\n","/home/aki/Documents/Lokian.eth/src/components/sharedToMe/index.js",["318","319"],"import React, {useState} from 'react'\r\nimport { nameDiv, imgDiv, statDiv } from '../common'\r\nimport Spinner from '../spinner'\r\nimport { Row, Col } from 'react-bootstrap'\r\nimport './sharedToMe.css'\r\nimport { useStopSharing } from '../../app-functions'\r\n\r\nconst SharedToMe = ({ otherCryptomons, account, library , refreshMons }) => {\r\n const [isStopSharingLoading, setIsStopSharingLoading] = useState(false)\r\n const { stopSharing } = useStopSharing(library, account, setIsStopSharingLoading, refreshMons)\r\n\r\n return (\r\n <>\r\n <div className=\"p1-shared-to-u green-glow\">Shared To Me</div>\r\n\r\n <div className=\"rpgui-container framed-grey table-container\">\r\n <Row>\r\n <Col xs md={12}>\r\n <div className=\"dojo-selection\">\r\n {otherCryptomons &&\r\n otherCryptomons\r\n .filter((mon) => mon?.sharedTo === account)\r\n .map((mon) => (\r\n <React.Fragment key={mon?.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n <div className=\"sharing-div\">\r\n <label className=\"shared-owner\">Creature Owner: {mon?.owner} </label>\r\n {isStopSharingLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button\r\n className=\"stop-sharing-btn rpgui-button\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => stopSharing(mon?.id)}\r\n >\r\n Stop sharing\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nexport default SharedToMe\r\n","/home/aki/Documents/Lokian.eth/src/components/token/index.tsx",["320","321"],"import React, { useState } from 'react'\r\nimport MonImages from '../../sprites-copy'\r\nimport { Container, Row, Col } from 'react-bootstrap'\r\nimport './token.css'\r\nimport NftItem from './nftItem'\r\nimport { useBurn, useBuyItem } from '../../app-functions'\r\nimport { useItemsFromNFT } from '../../hooks'\r\n\r\nconst Token = ({\r\n tokenBalance,\r\n library,\r\n account,\r\n refreshMons,\r\n}) => {\r\n const [burnAmount, setBurnAmount] = useState('0')\r\n const [buyItemAmount, setBuyItemAmount] = useState('0')\r\n const [disableBuyItemBtn, setDisableBuyItemBtn] = useState(false)\r\n\r\n const { buyItem } = useBuyItem(library, account, setDisableBuyItemBtn, refreshMons)\r\n const { burn } = useBurn(library, account, setDisableBuyItemBtn, refreshMons)\r\n\r\n // Get items from nft contract\r\n const { healingPotions, magicPotions, manaPotions, swords, shields } = useItemsFromNFT({\r\n library,\r\n account,\r\n disableBuyItemBtn,\r\n })\r\n\r\n function handleBuyItemAmount(event: React.ChangeEvent<HTMLInputElement>) {\r\n setBuyItemAmount(event.target?.value)\r\n }\r\n\r\n function handleBurn(event: React.ChangeEvent<HTMLInputElement>) {\r\n setBurnAmount(event.target?.value)\r\n }\r\n\r\n return (\r\n <>\r\n <div className=\"p1-token green-glow\">Your Tokens</div>\r\n\r\n <Container style={{ marginTop: '24px' }}>\r\n <Row>\r\n <Col xs={12} sm={12} md={6} lg={6} xl={6}>\r\n <Row>\r\n <Col lg={12} xl={12}>\r\n <div className=\"rpgui-container framed-grey\">\r\n <span style={{ fontSize: '1.5em' }}> {tokenBalance} </span>Lokians\r\n </div>\r\n </Col>\r\n <Col lg={12} xl={12}>\r\n <div className=\"rpgui-container framed-grey\">\r\n <div className=\"\" style={{ marginTop: '12px' }}>\r\n <span className=\"titles-token\">Inventory</span>\r\n <Row style={{ marginTop: '12px' }}>\r\n <Col>\r\n {swords && <NftItem item={swords} icon=\"sword\" slot=\"weapon-slot\" />}\r\n {shields && <NftItem item={shields} icon=\"shield\" slot=\"shield-slot\" />}\r\n {healingPotions && <NftItem item={healingPotions} icon=\"potion-red\" slot=\"potion-slot\" />}\r\n {manaPotions && <NftItem item={manaPotions} icon=\"potion-blue\" slot=\"potion-slot\" />}\r\n {magicPotions && <NftItem item={magicPotions} icon=\"potion-green\" slot=\"potion-slot\" />}\r\n </Col>\r\n </Row>\r\n </div>\r\n </div>\r\n </Col>\r\n <Col lg={12} xl={12}>\r\n <div className=\"rpgui-container framed-grey\">\r\n <span className=\"titles-token\">Give to the skellies </span> burn token\r\n <div className=\"skellies\">\r\n <img className=\"monImg\" src={MonImages['skelly']} alt=\"skeleton-people-1\" />\r\n <img className=\"monImg\" src={MonImages['skelly2']} alt=\"skeleton-people-1\" />\r\n <img className=\"monImg\" src={MonImages['skellyrip']} alt=\"skeleton-people-1\" />\r\n </div>\r\n <div className=\"give-to-skellies-input-btn\">\r\n <div className=\"form-line with-burn burn-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={burnAmount}\r\n onChange={(e) => handleBurn(e)}\r\n />\r\n </div>\r\n <div className=\"form-line with-burn burn-btn\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n onClick={() => burn(burnAmount)}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Give\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </Col>\r\n </Row>\r\n </Col>\r\n <Col xs={12} sm={12} md={6} lg={6} xl={6}>\r\n <div className=\"rpgui-container framed-grey\">\r\n <div className=\"\" style={{ marginBottom: '24px' }}>\r\n <span className=\"titles-token\">Buy Items (NFT)</span>\r\n </div>\r\n <div className=\"sharing-area\">\r\n <div style={{ marginBottom: '24px' }}>Equipment (cost)</div>\r\n <span className=\"item-label\">\r\n <div className=\"rpgui-icon sword\"></div> Sword\r\n </span>{' '}\r\n 500\r\n <div className=\"buy-item-input-container\">\r\n <div className=\"with-buy-item-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={buyItemAmount}\r\n onChange={(e) => handleBuyItemAmount(e)}\r\n />\r\n </div>\r\n <div className=\"with-buy-item\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n onClick={() => buyItem(buyItemAmount, '500', '3')}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Buy\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"sharing-area\" style={{ marginTop: '24px' }}>\r\n <span className=\"item-label\">\r\n <div className=\"rpgui-icon shield\"></div> Shield\r\n </span>{' '}\r\n 500\r\n <div className=\"buy-item-input-container\">\r\n <div className=\"with-buy-item-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={buyItemAmount}\r\n onChange={(e) => handleBuyItemAmount(e)}\r\n />\r\n </div>\r\n <div className=\"with-buy-item\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n onClick={() => buyItem(buyItemAmount, '500', '4')}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Buy\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"sharing-area\" style={{ marginTop: '24px' }}>\r\n <span>\r\n <div className=\"rpgui-icon potion-red\"></div>Healing Potion\r\n </span>{' '}\r\n 50\r\n <div className=\"buy-item-input-container\">\r\n <div className=\"with-buy-item-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={buyItemAmount}\r\n onChange={(e) => handleBuyItemAmount(e)}\r\n />\r\n </div>\r\n <div className=\"with-buy-item\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => buyItem(buyItemAmount, '50', '0')}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Buy\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"sharing-area\" style={{ marginTop: '24px' }}>\r\n <span>\r\n <div className=\"rpgui-icon potion-blue\"></div>Mana Potion\r\n </span>{' '}\r\n 50\r\n <div className=\"buy-item-input-container\">\r\n <div className=\"with-buy-item-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={buyItemAmount}\r\n onChange={(e) => handleBuyItemAmount(e)}\r\n />\r\n </div>\r\n <div className=\"with-buy-item\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => buyItem(buyItemAmount, '50', '1')}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Buy\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"sharing-area\" style={{ marginTop: '24px' }}>\r\n <span>\r\n <div className=\"rpgui-icon potion-green\"></div>Magic Potion\r\n </span>{' '}\r\n 50\r\n <div className=\"buy-item-input-container\">\r\n <div className=\"with-buy-item-input\">\r\n <input\r\n className=\"form-input\"\r\n placeholder=\"0\"\r\n value={buyItemAmount}\r\n onChange={(e) => handleBuyItemAmount(e)}\r\n />\r\n </div>\r\n <div className=\"with-buy-item\">\r\n <button\r\n className=\"rpgui-button token-input-btn\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => buyItem(buyItemAmount, '50', '2')}\r\n disabled={disableBuyItemBtn}\r\n >\r\n Buy\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </Col>\r\n </Row>\r\n </Container>\r\n </>\r\n )\r\n}\r\n\r\nexport default Token\r\n","/home/aki/Documents/Lokian.eth/src/components/share/index.tsx",["322","323"],"import React, { useState } from 'react'\r\nimport { nameDiv, imgDiv, statDiv } from '../common'\r\nimport Spinner from '../spinner'\r\nimport './share.css'\r\nimport { Row, Col } from 'react-bootstrap'\r\nimport { useStartSharing, useStopSharing } from '../../app-functions'\r\nimport { Lokimon } from '../../models'\r\n\r\nconst Share = ({ myCryptomons, account, library, refreshMons }) => {\r\n const [shareId, setShareId] = useState<string>('')\r\n const [shareAddress, setShareAddress] = useState('')\r\n\r\n const [isShareLoading, setIsShareLoading] = useState(false)\r\n const [isStopSharingLoading, setIsStopSharingLoading] = useState(false)\r\n\r\n const { startSharing } = useStartSharing(library, account, setIsShareLoading, refreshMons)\r\n const { stopSharing } = useStopSharing(library, account, setIsStopSharingLoading, refreshMons)\r\n\r\n function handleShareId(event: React.ChangeEvent<HTMLInputElement>) {\r\n setShareId(event.target?.value)\r\n }\r\n\r\n function handleShareAddress(event: React.ChangeEvent<HTMLInputElement>) {\r\n setShareAddress(event.target?.value)\r\n }\r\n\r\n return (\r\n <>\r\n <div className=\"p1-share green-glow\">Share</div>\r\n\r\n <div className=\"rpgui-container framed-grey vs-container\" style={{ marginTop: '24px', marginBottom: '48px' }}>\r\n <div className=\"form-line-share\">\r\n <label className=\"form-label\">Creature Id:</label>\r\n <input className=\"form-input\" value={shareId} onChange={(e) => handleShareId(e)} />\r\n </div>\r\n <div className=\"form-line-share\">\r\n <label className=\"form-label\">Share to address:</label>\r\n <input className=\"form-input\" value={shareAddress} onChange={(e) => handleShareAddress(e)} />\r\n </div>\r\n <div className=\"form-line-share\">\r\n {isShareLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button\r\n className=\"rpgui-button share-btn\"\r\n type=\"button\"\r\n onClick={() => startSharing(parseInt(shareId), shareAddress)}\r\n >\r\n Share\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n\r\n <div className=\"rpgui-container framed-grey table-container\">\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Shared LokiMon</div>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col xs md={12}>\r\n <div className=\"dojo-selection\">\r\n {myCryptomons &&\r\n myCryptomons\r\n .filter(\r\n (mon: Lokimon) =>\r\n mon.sharedTo.toLowerCase() !== account?.toString().toLocaleLowerCase() && !mon.forSale\r\n )\r\n .map((mon: Lokimon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n <div className=\"sharing-div\">\r\n <div className=\"shareTo-owner\">Shared to address: {mon.sharedTo} </div>\r\n {isStopSharingLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button\r\n className=\"stop-sharing-btn rpgui-button\"\r\n type=\"button\"\r\n style={{ float: 'right' }}\r\n onClick={() => stopSharing(mon.id)}\r\n >\r\n Stop sharing\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nexport default Share\r\n","/home/aki/Documents/Lokian.eth/src/components/marketplace/index.tsx",["324","325"],"import { formatUnits } from '@ethersproject/units'\r\nimport React, { useState, useEffect } from 'react'\r\nimport MonImages from '../../sprites-copy'\r\nimport { nameDiv, imgDiv, statDiv, buyDiv, monName } from '../common'\r\nimport getMonsOrder from '../common/getMonsOrder'\r\nimport ListRender from '../common/listRender'\r\nimport { Lokimon } from '../../models'\r\nimport Spinner from '../spinner'\r\nimport { Table } from 'react-bootstrap'\r\nimport './marketplace.css'\r\nimport { useBuyMon } from '../../app-functions'\r\nimport { BigNumber } from 'ethers'\r\n\r\nconst Marketplace = ({ otherCryptomons, contract, refreshMons, nativeTok = '' }) => {\r\n const [display, setDisplay] = useState('grid')\r\n const [orderBy, setOrderBy] = useState(null)\r\n const [otherLokimons, setOtherLokimons] = useState(otherCryptomons)\r\n const [isBuyMonLoading, setIsBuyMonLoading] = useState(false)\r\n\r\n const { buyMon } = useBuyMon(contract, setIsBuyMonLoading, refreshMons)\r\n\r\n useEffect(() => {\r\n if (!otherCryptomons) return\r\n setOtherLokimons(otherCryptomons)\r\n }, [otherCryptomons])\r\n\r\n useEffect(() => {\r\n if (!orderBy) return\r\n const _otherLokimons = getMonsOrder(orderBy, otherCryptomons)\r\n setOtherLokimons([..._otherLokimons])\r\n }, [orderBy])\r\n\r\n return (\r\n <>\r\n <ListRender\r\n pageName={'Marketplace'}\r\n onSetDisplay={(value: string) => setDisplay(value)}\r\n onSetOrder={(evtKey: string) => setOrderBy(evtKey)}\r\n />\r\n\r\n {display === 'grid' && (\r\n <div className=\"mylokimons-container\">\r\n {otherLokimons &&\r\n otherLokimons\r\n .filter((mon: Lokimon) => mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n {buyDiv(mon, isBuyMonLoading, buyMon)}\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n )}\r\n\r\n {display === 'list' && (\r\n <Table striped bordered hover variant=\"dark\" responsive className='mylokimons-table'>\r\n <thead>\r\n <tr>\r\n <th>ID</th>\r\n <th>Img</th>\r\n <th>Name</th>\r\n <th>Stats</th>\r\n <th>Price</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {otherLokimons &&\r\n otherLokimons\r\n .filter((mon: Lokimon) => !mon.forSale)\r\n .map((mon: Lokimon, idx: number) => (\r\n <tr key={'market' + idx}>\r\n <td>{mon?.id?.toString()}</td>\r\n <td>\r\n {' '}\r\n <div style={{ border: '2px solid gray', padding: '3px', borderRadius: '4px' }}>\r\n <img\r\n className=\"mylokimons-img\"\r\n src={MonImages[`${mon.species + 1 || 0}`]}\r\n alt={mon?.species?.toString() || 'none'}\r\n height=\"45\"\r\n width=\"45\"\r\n />\r\n </div>\r\n </td>\r\n <td>{monName(mon?.species) || ''} </td>\r\n <td>{`HP ${mon?.hp}, ATK ${mon?.atk}, DEF ${mon?.def}, SPD ${mon?.speed}`}</td>\r\n <td>{`${formatUnits(BigNumber.from(mon?.price || 0))} ${nativeTok}`}</td>\r\n <td>\r\n <button\r\n className=\"rpgui-button mylokimons-sell-btn\"\r\n type=\"button\"\r\n onClick={() => (mon?.id && mon?.price ? buyMon(mon?.id, mon?.price) : null)}\r\n >\r\n {isBuyMonLoading ? <Spinner color=\"#000\" /> : 'Buy'}\r\n </button>\r\n </td>\r\n </tr>\r\n ))}\r\n </tbody>\r\n </Table>\r\n )}\r\n </>\r\n )\r\n}\r\n\r\nexport default Marketplace\r\n","/home/aki/Documents/Lokian.eth/src/components/myShop/index.tsx",["326","327"],"import React, { useState, useEffect } from 'react'\r\nimport { nameDiv, imgDiv, statDiv, removeFromSaleDiv, monName } from '../common'\r\nimport getMonsOrder from '../common/getMonsOrder'\r\nimport ListRender from '../common/listRender'\r\nimport { Lokimon } from '../../models'\r\nimport { Table } from 'react-bootstrap'\r\nimport MonImages from '../../sprites-copy'\r\nimport Spinner from '../spinner'\r\nimport { formatUnits } from '@ethersproject/units'\r\nimport { BigNumber } from 'ethers'\r\nimport { useRemoveFromSale } from '../../app-functions'\r\n\r\nconst MyShop = ({ myCryptomons, contract, refreshMons, nativeTok = '' }) => {\r\n const [display, setDisplay] = useState('grid')\r\n const [orderBy, setOrderBy] = useState(null)\r\n const [myLokimons, setMyLokimons] = useState(myCryptomons)\r\n const [isRemoveFromSaleLoading, setIsRemoveFromSaleLoading] = useState(false)\r\n\r\n const { removeFromSale } = useRemoveFromSale(contract, setIsRemoveFromSaleLoading, refreshMons)\r\n\r\n useEffect(() => {\r\n if (!myCryptomons) return\r\n setMyLokimons(myCryptomons)\r\n }, [myCryptomons])\r\n\r\n useEffect(() => {\r\n if (!orderBy) return\r\n const _lokimons = getMonsOrder(orderBy, myCryptomons)\r\n setMyLokimons([..._lokimons])\r\n }, [orderBy])\r\n\r\n return (\r\n <>\r\n <ListRender\r\n pageName={'My Shop'}\r\n onSetDisplay={(value: string) => setDisplay(value)}\r\n onSetOrder={(evtKey: string) => setOrderBy(evtKey)}\r\n />\r\n\r\n {display === 'grid' && (\r\n <div className=\"mylokimons-container\">\r\n {myCryptomons &&\r\n myCryptomons\r\n .filter((mon: Lokimon) => mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n {removeFromSaleDiv(mon, isRemoveFromSaleLoading, removeFromSale)}\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n )}\r\n\r\n {display === 'list' && (\r\n <Table striped bordered hover variant=\"dark\" responsive className='mylokimons-table'>\r\n <thead>\r\n <tr>\r\n <th>ID</th>\r\n <th>Img</th>\r\n <th>Name</th>\r\n <th>Stats</th>\r\n <th>Price</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {myLokimons &&\r\n myLokimons\r\n .filter((mon: Lokimon) => mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <tr key={mon.id}>\r\n <td>{mon?.id}</td>\r\n <td>\r\n {' '}\r\n <div style={{ border: '2px solid gray', padding: '3px', borderRadius: '4px' }}>\r\n <img\r\n className=\"mylokimons-img\"\r\n src={MonImages[`${mon.species + 1 || 0}`]}\r\n alt={mon?.species?.toString() || 'none'}\r\n height=\"45\"\r\n width=\"45\"\r\n />\r\n </div>\r\n </td>\r\n <td>{monName(mon?.species) || ''} </td>\r\n <td>{`HP ${mon?.hp}, ATK ${mon?.atk}, DEF ${mon?.def}, SPD ${mon?.speed}`}</td>\r\n <td>{`${formatUnits(BigNumber.from(mon?.price || 0))} ${nativeTok}`}</td>\r\n <td>\r\n <button\r\n className=\"rpgui-button mylokimons-sell-btn\"\r\n type=\"button\"\r\n onClick={() => (mon?.id ? removeFromSale(mon?.id) : null)}\r\n >\r\n {isRemoveFromSaleLoading ? <Spinner color=\"#000\" /> : 'Delist'}\r\n </button>\r\n </td>\r\n </tr>\r\n ))}\r\n </tbody>\r\n </Table>\r\n )}\r\n </>\r\n )\r\n}\r\n\r\nexport default MyShop\r\n","/home/aki/Documents/Lokian.eth/src/components/myLokiMons/index.tsx",["328","329"],"import React, { useState, useEffect } from 'react'\r\nimport { Table } from 'react-bootstrap'\r\nimport MonImages from '../../sprites-copy'\r\nimport { nameDiv, imgDiv, statDiv, addForSaleDiv, monName } from '../common'\r\nimport getMonsOrder from '../common/getMonsOrder'\r\nimport ListRender from '../common/listRender'\r\nimport { Lokimon } from '../../models'\r\nimport Spinner from '../spinner'\r\nimport './mylokimons.css'\r\nimport { useAddForSale } from '../../app-functions'\r\n\r\nconst MyLokiMons = ({ myCryptomons, contract, refreshMons }) => {\r\n const [display, setDisplay] = useState('grid')\r\n const [orderBy, setOrderBy] = useState(null)\r\n const [myLokimons, setMyLokimons] = useState(myCryptomons)\r\n const [price, setPrice] = useState(0)\r\n const [isAddForSaleLoading, setIsAddForSaleLoading] = useState<boolean>(false)\r\n\r\n const { addForSale } = useAddForSale(contract, setIsAddForSaleLoading, refreshMons)\r\n\r\n useEffect(() => {\r\n if (!myCryptomons) return\r\n setMyLokimons(myCryptomons)\r\n }, [myCryptomons])\r\n\r\n useEffect(() => {\r\n if (!orderBy) return\r\n const _lokimons = getMonsOrder(orderBy, myLokimons)\r\n setMyLokimons([..._lokimons])\r\n }, [orderBy])\r\n\r\n function handleChangePrice(event: React.ChangeEvent<HTMLInputElement>) {\r\n const parsedValue = parseFloat(event?.target?.value) || 0\r\n setPrice(parsedValue)\r\n }\r\n\r\n\r\n return (\r\n <>\r\n <ListRender\r\n pageName={'My LokiMons'}\r\n onSetDisplay={(value: string) => setDisplay(value)}\r\n onSetOrder={(evtKey: string) => setOrderBy(evtKey)}\r\n />\r\n\r\n {display === 'grid' && (\r\n <div className=\"mylokimons-container\">\r\n {myLokimons &&\r\n myLokimons\r\n .filter((mon: Lokimon) => !mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n {addForSaleDiv(mon, price, handleChangePrice, isAddForSaleLoading, addForSale)}\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n )}\r\n\r\n {display === 'list' && (\r\n <Table striped bordered hover variant=\"dark\" responsive className=\"mylokimons-table\">\r\n <thead>\r\n <tr>\r\n <th>ID</th>\r\n <th>Img</th>\r\n <th>Name</th>\r\n <th>Stats</th>\r\n <th>Price</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {myLokimons &&\r\n myLokimons\r\n .filter((mon: Lokimon) => !mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <tr key={mon.id}>\r\n <td>{mon?.id}</td>\r\n <td>\r\n {' '}\r\n <div style={{ border: '2px solid gray', padding: '3px', borderRadius: '4px' }}>\r\n <img\r\n className=\"mylokimons-img\"\r\n src={MonImages[`${parseInt(mon?.species?.toString()) + 1}`]}\r\n alt={mon?.species?.toString()}\r\n height=\"45\"\r\n width=\"45\"\r\n />\r\n </div>\r\n </td>\r\n <td>{monName(mon?.species) || ''} </td>\r\n <td>{`HP ${mon?.hp}, ATK ${mon?.atk}, DEF ${mon?.def}, SPD ${mon?.speed}`}</td>\r\n <td>\r\n <input\r\n type=\"number\"\r\n className=\"add-for-sale-input\"\r\n value={price}\r\n onChange={(e) => {\r\n // onHandlePriceChange(e)\r\n handleChangePrice(e)\r\n }}\r\n />\r\n </td>\r\n <td>\r\n <button\r\n className=\"rpgui-button mylokimons-sell-btn\"\r\n type=\"button\"\r\n value={price}\r\n onClick={() => addForSale(mon?.id, price)}\r\n >\r\n {isAddForSaleLoading ? <Spinner color=\"#000\" /> : 'Sell'}\r\n </button>\r\n </td>\r\n </tr>\r\n ))}\r\n </tbody>\r\n </Table>\r\n )}\r\n </>\r\n )\r\n}\r\n\r\nexport default MyLokiMons\r\n","/home/aki/Documents/Lokian.eth/src/components/breed/index.tsx",["330","331"],"import React, { useState } from 'react'\r\nimport { nameDiv, imgDiv, statDiv, breedOption, breedDiv, monName } from '../common'\r\nimport Spinner from '../spinner'\r\nimport { Row, Col, Container } from 'react-bootstrap'\r\nimport { Lokimon } from '../../models'\r\nimport './breed.css'\r\nimport { useBreedMons } from '../../app-functions'\r\n\r\nconst Breed = ({ myCryptomons, contract, refreshMons }) => {\r\n const [breedChoice1, setBreedChoice1] = useState(null)\r\n const [breedChoice2, setBreedChoice2] = useState(null)\r\n\r\n const [isBreedMonLoading, setIsBreedMonLoading] = useState(false)\r\n\r\n const { breedMons } = useBreedMons(contract, setIsBreedMonLoading, refreshMons)\r\n\r\n return (\r\n <>\r\n <div className=\"p1-breed green-glow\">Breed</div>\r\n\r\n <div className=\"rpgui-container framed-grey vs-container\" style={{ marginTop: '24px' }}>\r\n <Container fluid>\r\n <Row>\r\n <Col xs=\"12\" lg=\"12\" className=\"col-text-center\">\r\n <span>\r\n {breedChoice1 !== null\r\n ? monName(\r\n myCryptomons?.find((mon: Lokimon) => mon.id?.toString() === breedChoice1?.toString())?.species\r\n )\r\n : ''}{' '}\r\n {breedChoice1 !== null ? `no.${breedChoice1}` : ''}\r\n </span>\r\n </Col>\r\n <Col md=\"12\" className=\"col-text-center\">\r\n {breedChoice1 !== null ? '+' : ''}\r\n </Col>\r\n <Col xs=\"12\" lg=\"12\" className=\"col-text-center\">\r\n <span>\r\n {breedChoice2 !== null\r\n ? monName(\r\n myCryptomons?.find((mon: Lokimon) => mon.id?.toString() === breedChoice2?.toString())?.species\r\n )\r\n : ''}{' '}\r\n {breedChoice2 !== null ? `no.${breedChoice2}` : ''}\r\n </span>\r\n </Col>\r\n </Row>\r\n </Container>\r\n </div>\r\n\r\n <div className=\"breeding-area\" style={{ marginTop: '9px' }}>\r\n <div className=\"breed-selected-mons-img\">\r\n {breedOption(breedChoice1, myCryptomons)}\r\n {breedOption(breedChoice2, myCryptomons)}\r\n </div>\r\n {isBreedMonLoading ? (\r\n <button className=\"rpgui-button\" type=\"button\" style={{ width: '100%' }}>\r\n <Spinner color=\"#000\" />\r\n </button>\r\n ) : (\r\n <button\r\n className=\"rpgui-button breed-btn\"\r\n type=\"button\"\r\n onClick={() => breedMons(breedChoice1, breedChoice2)}\r\n disabled={breedChoice1 === breedChoice2}\r\n >\r\n Breed choosen lokimons\r\n </button>\r\n )}\r\n </div>\r\n\r\n <div className=\"rpgui-container framed-grey table-container\">\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Select Lokimon</div>\r\n </Col>\r\n <Col xs md={12}>\r\n <div className=\"dojo-selection\">\r\n {myCryptomons &&\r\n myCryptomons\r\n .filter((mon: Lokimon) => !mon.forSale)\r\n .map((mon: Lokimon) => (\r\n <React.Fragment key={mon?.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n {breedDiv(mon, setBreedChoice1, setBreedChoice2)}\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nexport default Breed\r\n","/home/aki/Documents/Lokian.eth/src/components/arenaSocketIo/index.tsx",["332","333","334","335"],"import React, { useState, useEffect } from 'react'\nimport 'bootstrap/dist/css/bootstrap.min.css'\nimport '../../App.css'\nimport '../arena/arena.css'\nimport { Container, Row, Col, Button } from 'react-bootstrap'\n// import gameContext from '../../gameContext'\nimport MyFightingMons from '../arena/myFightingMons'\n// import { RoomType } from '../common/interfaces'\nimport { Lokimon } from '../../models'\nimport { breedOption } from '../common'\n\nconst ArenaSocketIo = ({\n account,\n fightChoice1,\n fightChoice2,\n monNames,\n cryptomons,\n setFightChoice2Func,\n setFightChoice1Func,\n}) => {\n const [roomName, setRoomName] = useState('')\n const [isJoining, setJoining] = useState(false)\n const [creatorMons, setCreatorMons] = useState<Lokimon[]>(null)\n\n // const { setInRoom, isInRoom } = useContext(gameContext)\n\n useEffect(() => {\n if (cryptomons) {\n setCreatorMons(cryptomons.filter((mon: Lokimon) => account === mon.owner))\n }\n\n // return () => {\n // second\n // }\n }, [])\n\n const handleRoomNameChange = (e: React.ChangeEvent<any>) => {\n const value = e.target.value\n setRoomName(value)\n }\n\n const joinRoom = async (e: React.FormEvent) => {\n e.preventDefault()\n\n // const socket = socketService.socket\n // if (!roomName || roomName.trim() === '' || !socket) return\n\n // setJoining(true)\n\n // const joined = await gameService.joinGameRoom(socket, roomName).catch((err) => {\n // alert(err)\n // })\n\n // if (joined) setInRoom(true)\n\n // setJoining(false)\n }\n\n return (\n <>\n <div className='p1-arena green-glow'>Arena P2P</div>\n <Container fluid>\n <Row className='online-create-room-row'>\n {/* <Col sm={12} xs={12} md={6} lg={6} xl={6}>\n <span className='online-count'>\n Peer ID: {peerId || ''} (connect or announce id at chatbox)\n </span>\n </Col> */}\n <Col>\n <div className='create-room-btn'>\n <form onSubmit={joinRoom}>\n <h4>Enter Room ID to Join a Game</h4>\n <div className='d-flex'>\n <input placeholder='Room ID' value={roomName} onChange={handleRoomNameChange} />\n <Button type='submit' disabled={isJoining}>\n {isJoining ? 'Joining...' : 'Join'}\n </Button>\n </div>\n \n </form>\n </div>\n </Col>\n </Row>\n\n <Row>\n <Col>\n <div className='room-container'>\n {/* upper creator/player1/withPeerId select area */}\n <div className='rpgui-container framed-grey table-container'>\n <Row>\n <Col xs md={12}>\n <div style={{ textAlign: 'center' }}>Player 1 Select</div>\n </Col>\n </Row>\n <Row>\n <Col xs md={12}>\n <div className='dojo-selection'>\n <MyFightingMons\n mons={creatorMons}\n setFightChoiceFunc={setFightChoice1Func}\n account={account}\n choice='1'\n />\n </div>\n </Col>\n </Row>\n </div>\n\n {/* center fight isle */}\n <div\n className='rpgui-container framed-grey vs-container'\n style={{ marginTop: '24px' }}\n >\n <Container fluid>\n <Row>\n <Col xs md='12' className='col-text-center'>\n Selected Lokimon\n </Col>\n <Col xs='12' lg='12' className='col-text-center'>\n <span>\n {\n monNames[\n cryptomons.find(\n (mon: Lokimon) => mon.id?.toString() === fightChoice1?.toString(),\n )?.species\n ]\n }{' '}\n {fightChoice1 ? `no.${fightChoice1}` : fightChoice1 == '0' ? `no.${0}` : ''}\n </span>\n </Col>\n <Col xs='12' lg='12' className='col-text-center'>\n <span>\n {\n monNames[\n cryptomons.find(\n (mon: Lokimon) => mon.id?.toString() === fightChoice2?.toString(),\n )?.species\n ]\n }{' '}\n {fightChoice2 ? `no.${fightChoice2}` : ''}\n </span>\n </Col>\n </Row>\n <div className='dojo-spar-mons-img'>\n {breedOption(parseInt(fightChoice1), cryptomons)}\n {breedOption(parseInt(fightChoice2), cryptomons)}\n </div>\n </Container>\n </div>\n\n {/* upper joiner/player2 select area */}\n <div className='rpgui-container framed-grey table-container'>\n <Row>\n <Col xs md={12}>\n <div style={{ textAlign: 'center' }}>Player 2 Select</div>\n </Col>\n </Row>\n <Row>\n <Col xs md={12}>\n <div className='dojo-selection'>\n <MyFightingMons\n mons={[]}\n setFightChoiceFunc={setFightChoice2Func}\n account={''}\n choice='2'\n />\n </div>\n </Col>\n </Row>\n </div>\n </div>\n </Col>\n </Row>\n </Container>\n\n {/* react version */}\n Made with ❤️🔥 react v{React.version}\n </>\n )\n}\n\nexport default ArenaSocketIo\n","/home/aki/Documents/Lokian.eth/src/components/arena/index.tsx",["336","337","338","339"],"import 'bootstrap/dist/css/bootstrap.min.css'\r\nimport '../../App.css'\r\nimport { toast } from 'react-toastify'\r\nimport 'react-toastify/dist/ReactToastify.css'\r\n// import Spinner from '../spinner'\r\nimport { Container, Row, Col, Table } from 'react-bootstrap'\r\nimport React, { useState, useEffect } from 'react'\r\nimport './arena.css'\r\nimport { \r\n RoomType, \r\n // UseLocDiscon \r\n} from '../common/interfaces'\r\n// import WebSocket from 'isomorphic-ws'\r\nimport { \r\n // Link, \r\n // Outlet, \r\n useOutletContext, \r\n // useNavigate, \r\n // useLocation \r\n} from 'react-router-dom'\r\n// import { ethers } from 'ethers'\r\nimport { getAccount, waitForWsConnection } from '../../utils'\r\nimport { toastErrParams } from '../../utils/toastErrParams'\r\nimport { start } from 'repl'\r\nimport Room from './room'\r\n\r\nconst btnStyle = {\r\n height: '38px',\r\n color: '#000',\r\n}\r\n\r\n// change to server on internet\r\nconst URL = 'ws://localhost:40510'\r\n\r\ntype ContextType = { ws: WebSocket | null }\r\n\r\nexport const getFirst7AndLast4CharOfAcct = (acct: string): string => {\r\n if (!acct) return\r\n return `${acct.substring(0, 6)}...${acct.substring(acct.length - 4)}`\r\n}\r\n\r\nexport const useWs = () => {\r\n return useOutletContext<ContextType>()\r\n}\r\n\r\nconst Arena = ({\r\n account,\r\n // onStartedRoom,\r\n // hasStartedRoom,\r\n // onDisbanded,\r\n // history,\r\n fightRouteProps,\r\n commonRouteProps,\r\n mainContract,\r\n}) => {\r\n // const navigate = useNavigate()\r\n // const useLoc: UseLocDiscon = useLocation()\r\n\r\n const [online, setOnline] = useState<number>(null)\r\n const [toggleChatbox, setToggleChatbox] = useState<boolean>(false)\r\n const [arenaChatMsgs, setArenaChatMsgs] = useState<string>('')\r\n const [arenaChatInput, setArenaChatInput] = useState<string>('')\r\n const [rooms, setRooms] = useState<RoomType[]>([])\r\n const [ws, setWs] = useState<WebSocket>(new WebSocket(URL))\r\n\r\n const showMessage = (message: string) => {\r\n let messages = arenaChatMsgs\r\n messages += `\\n${message}`\r\n setArenaChatMsgs(messages)\r\n }\r\n\r\n const sendMsg = () => {\r\n if (!ws) return\r\n ws.send(\r\n JSON.stringify({\r\n type: 'chat',\r\n msg: arenaChatInput,\r\n acct: getFirst7AndLast4CharOfAcct(account),\r\n }),\r\n )\r\n showMessage(`YOU: ${arenaChatInput}`)\r\n }\r\n\r\n const createRoom = () => {\r\n const obj = { type: 'create', params: { creator: account } }\r\n \r\n try {\r\n waitForWsConnection(ws, ws?.send(JSON.stringify(obj)), 1000)\r\n\r\n } catch (error) {\r\n toast.error(\r\n error?.message || error || 'Error creating room',\r\n toastErrParams,\r\n )\r\n }\r\n // if (ws) ws.send(JSON.stringify(obj))\r\n }\r\n\r\n const joinRoom = (roomCode: string, creator: string) => {\r\n if (ws) {\r\n const obj = { type: 'join', params: { code: roomCode, player: account, creator } }\r\n ws.send(JSON.stringify(obj))\r\n }\r\n }\r\n\r\n const [startedRoom, setStartedRoom] = useState<RoomType>(null)\r\n // const [disbanded, setDisbanded] = useState(false)\r\n\r\n const startRoom = (room: RoomType) => {\r\n if (!room || !room.clients || room.clients !== 2) return\r\n\r\n const path = '/arena/room/' + room?.room || ''\r\n const obj = { type: 'start', params: { room, path } }\r\n\r\n // waitForWsConnection(ws, ws?.send(JSON.stringify(obj)), 1000)\r\n if (ws) {\r\n ws.send(JSON.stringify(obj))\r\n\r\n // onStartedRoom(room)\r\n setStartedRoom(room)\r\n }\r\n }\r\n\r\n const leaveRoom = (\r\n roomPlayers: string[],\r\n roomCreator: string,\r\n roomLeaver: string,\r\n roomCode: string,\r\n ) => {\r\n if (ws) {\r\n let isCreator = false\r\n if (account?.toString() === roomCreator) {\r\n isCreator = true\r\n }\r\n\r\n const obj = {\r\n type: 'leave',\r\n params: { \r\n players: roomPlayers, \r\n isCreator, \r\n leaver: roomLeaver, \r\n code: roomCode,\r\n creator: roomCreator, \r\n },\r\n }\r\n\r\n if (roomPlayers?.includes(account)) {\r\n ws.send(JSON.stringify(obj))\r\n }\r\n }\r\n }\r\n\r\n async function getMyAccount() {\r\n return await getAccount()\r\n }\r\n\r\n // useEffect(() => {\r\n // if (!otherPlayerReady) return\r\n\r\n // const obj = { type: 'ready', params: { room: otherPlayerReady.room, otherPlayer: otherPlayerReady.otherPlayer } }\r\n // if (ws) {\r\n // if (otherPlayerReady.otherPlayer === account) {\r\n // ws.send(JSON.stringify(obj))\r\n // }\r\n // }\r\n // }, [otherPlayerReady])\r\n\r\n // useEffect(() => {\r\n // if (!useLoc || !useLoc.state) return\r\n\r\n // if (useLoc.state.isDisbandedAndOtherPlayer) {\r\n // let leavedRooms = [...rooms]\r\n // const roomCode = useLoc.state.roomCode || null\r\n\r\n // if (!roomCode) {\r\n // console.log('Room code is missing', toastErrParams)\r\n // return\r\n // }\r\n\r\n // leavedRooms = leavedRooms.filter((room) => room.room !== roomCode)\r\n\r\n // setRooms(leavedRooms)\r\n // } else {\r\n // leaveRoom(\r\n // useLoc.state?.room?.players,\r\n // useLoc.state?.room?.creator,\r\n // useLoc.state?.leaver,\r\n // useLoc.state?.room?.room,\r\n // )\r\n // }\r\n // }, [useLoc])\r\n\r\n const [startRedirect, setStartRedirect] = useState('')\r\n\r\n useEffect(() => {\r\n if (!ws) return\r\n\r\n ws.onopen = function open() {\r\n console.log('connected')\r\n let _account = account\r\n\r\n if (!_account) {\r\n getMyAccount().then((result) => {\r\n _account = result\r\n\r\n if (ws) {\r\n ws.send(\r\n JSON.stringify({\r\n type: 'online',\r\n msg: 'connected',\r\n acct: _account,\r\n }),\r\n )\r\n }\r\n })\r\n }\r\n\r\n // if (ws) {\r\n // ws.send(\r\n // JSON.stringify({\r\n // type: 'online',\r\n // msg: 'connected',\r\n // acct: _account,\r\n // })\r\n // )\r\n // }\r\n\r\n // get created rooms\r\n if (ws) {\r\n ws.send(\r\n JSON.stringify({\r\n type: 'get_rooms',\r\n }),\r\n )\r\n }\r\n }\r\n\r\n ws.onmessage = function incoming(data) {\r\n if (!data || !data.data) return\r\n const parsed = JSON.parse(data.data)\r\n\r\n let chatMsg = ''\r\n\r\n let prevRooms = rooms?.length ? [...rooms] : null\r\n\r\n switch (parsed.type) {\r\n case 'info': {\r\n console.log('info data', parsed)\r\n toast.error(parsed?.params?.msg || 'Error')\r\n break\r\n }\r\n case 'chat': {\r\n console.log('chat data', parsed)\r\n\r\n chatMsg = `${parsed?.acct || 'unknown'}: ${parsed?.msg}`\r\n break\r\n }\r\n case 'online':\r\n setOnline(parsed?.online || online)\r\n break\r\n\r\n case 'leave':\r\n case 'join':\r\n case 'create':\r\n case 'get_rooms': {\r\n console.log(parsed)\r\n\r\n if (parsed && parsed.allRooms) {\r\n \r\n const allRooms = Object.keys(parsed.allRooms)?.map(k => {\r\n \r\n const connectedRooms = parsed.allRooms[k]\r\n \r\n if (connectedRooms.length > 1) {\r\n\r\n\r\n\r\n const formatRoom: RoomType = {\r\n room: connectedRooms[1].params?.room,\r\n players: connectedRooms[1].params?.players,\r\n creator: connectedRooms[1].params?.creator,\r\n clients: connectedRooms[1].params?.clients,\r\n leaver: connectedRooms[1]?.params?.leaver || '',\r\n }\r\n\r\n return formatRoom\r\n\r\n } else {\r\n\r\n const formatRoom: RoomType = {\r\n room: connectedRooms[0]?.params?.room,\r\n players: connectedRooms[0]?.params?.players,\r\n creator: connectedRooms[0]?.params?.creator,\r\n clients: connectedRooms[0]?.params?.clients,\r\n leaver: connectedRooms[0]?.params?.leaver || '',\r\n }\r\n \r\n return formatRoom\r\n\r\n }\r\n\r\n }) || null\r\n \r\n \r\n if (allRooms?.length) {\r\n prevRooms = [\r\n ...allRooms\r\n ]\r\n } else \r\n {\r\n prevRooms = null\r\n }\r\n \r\n }\r\n\r\n if (parsed.type === 'leave' && parsed?.params?.players?.includes(account)) {\r\n \r\n if ((parsed?.params?.leaver !== parsed?.params?.creator) || parsed?.params?.isClosed) {\r\n setStartedRoom(null)\r\n setStartRedirect('')\r\n }\r\n\r\n\r\n let leaver = 'Player '\r\n leaver = getFirst7AndLast4CharOfAcct( parsed?.params?.leaver )\r\n toast.error(\r\n (leaver || 'Player ') + ' disconnected at room ' + parsed?.params?.room,\r\n toastErrParams,\r\n )\r\n }\r\n\r\n setRooms( prevRooms?.length ? prevRooms : null )\r\n \r\n break\r\n }\r\n\r\n\r\n case 'start': {\r\n console.log('start rooms data', parsed)\r\n setStartedRoom(parsed?.params?.room)\r\n setStartRedirect(parsed?.params?.path || '/arena/room')\r\n break\r\n \r\n }\r\n\r\n case 'ready': {\r\n console.log('inside arena', parsed)\r\n\r\n // if (parsed?.params?.playerType === 'creator') {\r\n // if (parsed.params?.readyPlayersData[parsed.params.room?.room]?.length === 2) {\r\n // setReadyToStart('start fight')\r\n // } else {\r\n // setReadyToStart('waiting for other player')\r\n // }\r\n // }\r\n\r\n // if (parsed?.params?.playerType === 'otherPlayer') {\r\n // setReadyToStart('waiting to start')\r\n // }\r\n\r\n break\r\n }\r\n }\r\n\r\n showMessage(chatMsg)\r\n }\r\n\r\n return () => {\r\n ws.onclose = () => {\r\n console.log('WebSocket Disconnected')\r\n setWs(new WebSocket(URL))\r\n }\r\n }\r\n }, [ws, ws.onmessage, ws.onopen, ws.onclose, account])\r\n\r\n\r\n\r\n\r\n\r\n return (\r\n <>\r\n {!!startRedirect && (\r\n <Room\r\n room={startedRoom}\r\n\r\n onDisconnect={(roomToLeave: RoomType) => {\r\n setStartedRoom(null)\r\n\r\n // roomPlayers: string[],\r\n // roomCreator: string,\r\n // roomLeaver: string,\r\n // roomCode: string,\r\n\r\n // room: string // or room code\r\n // players: string[]\r\n // creator: string\r\n // clients: number\r\n\r\n\r\n setStartRedirect('')\r\n\r\n \r\n if (roomToLeave && roomToLeave.isOtherPlayer) {\r\n leaveRoom(\r\n roomToLeave.players,\r\n roomToLeave.creator,\r\n roomToLeave.leaver,\r\n roomToLeave.room\r\n )\r\n } \r\n\r\n else {\r\n// update the room list\r\nif (ws) {\r\n // ws.send(\r\n // JSON.stringify({\r\n // type: 'get_rooms',\r\n // }),\r\n // )\r\n\r\n if (roomToLeave.leaver === roomToLeave.creator) {\r\n leaveRoom(\r\n roomToLeave.players,\r\n roomToLeave.creator,\r\n roomToLeave.leaver,\r\n roomToLeave.room\r\n )\r\n }\r\n else {\r\n\r\n waitForWsConnection(ws, ws.send(\r\n JSON.stringify({\r\n type: 'get_rooms',\r\n })), 1000)\r\n }\r\n}\r\n\r\n }\r\n \r\n\r\n }}\r\n // isDisbanded={disbanded}\r\n account={account}\r\n fightChoice1={fightRouteProps.fightChoice1}\r\n fightChoice2={fightRouteProps.fightChoice2}\r\n setFightChoice1Func={fightRouteProps.setFightChoice1}\r\n setFightChoice2Func={fightRouteProps.setFightChoice2}\r\n cryptomons={commonRouteProps.cryptomons}\r\n monNames={commonRouteProps.names}\r\n ws={ws}\r\n mainContract={mainContract}\r\n />\r\n )}\r\n {/* {hasStartedRoom ? ( */}\r\n {/* <div className='rpgui-container framed-grey'> */}\r\n {/* <Container fluid>\r\n <Outlet context={{ ws }} />\r\n </Container> */}\r\n {/* </div> */}\r\n {/* ) : (\r\n <> */}\r\n <div className='p1-arena green-glow'>Coming Soon...</div>\r\n\r\n {\r\n startRedirect ? '' : (\r\n <div className='rpgui-container framed-grey table-container'>\r\n <Container fluid>\r\n <Row className='online-create-room-row'>\r\n <Col sm={12} xs={12} md={6} lg={6} xl={6}>\r\n <span className='online-count'>Online: {online}</span>\r\n </Col>\r\n <Col sm={12} xs={12} md={6} lg={6} xl={6}>\r\n <div className='create-room-btn'>\r\n <button className='rpgui-button' type='button' onClick={() => createRoom()}>\r\n <span style={{ fontSize: '18px' }}>+</span> Create Room\r\n </button>\r\n </div>\r\n </Col>\r\n </Row>\r\n <Row></Row>\r\n <Row>\r\n <Col>\r\n <Table striped bordered hover variant='dark' responsive>\r\n <thead>\r\n <tr>\r\n <th>ID</th>\r\n <th>Players</th>\r\n <th>Code</th>\r\n <th>Status</th>\r\n <th>Action</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {rooms &&\r\n rooms.map((room, idx) => {\r\n if (!room) return\r\n return (\r\n <tr key={(room?.room || 'code') + '-' + idx}>\r\n <td>{idx + 1}</td>\r\n \r\n <td>\r\n {room?.players\r\n ?.map((player: string) => getFirst7AndLast4CharOfAcct(player))\r\n ?.join(', ')}\r\n </td>\r\n \r\n <td>{room?.room || ''}</td>\r\n <td>{room?.clients || 0}/2</td>\r\n \r\n <td>\r\n <button\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() =>\r\n leaveRoom(room?.players, room?.creator, account, room?.room)\r\n }\r\n style={{ maxHeight: btnStyle.height }}\r\n // disabled={room.clients === 2}\r\n >\r\n Leave\r\n </button>{' '}\r\n {room?.creator === account && (\r\n <button\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() => startRoom(room)}\r\n style={{ maxHeight: btnStyle.height, color: btnStyle.color }}\r\n disabled={room.clients !== 2}\r\n >\r\n {/* {room.clients !== 2 ? (\r\n 'Waiting'\r\n ) : (\r\n <Link\r\n // onClick={() => startRoom(room)}\r\n // onClick={() => startRoom(room)}\r\n to={'/arena/room/' + room?.room || ''}\r\n >\r\n Start{' '}\r\n </Link>\r\n )} */}\r\n {room?.clients === 2 ? 'Start' : 'Waiting'}\r\n </button>\r\n )}\r\n {room?.creator !== account && (\r\n <button\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() => joinRoom(room?.room || '', room?.creator)}\r\n style={{ maxHeight: btnStyle.height }}\r\n disabled={room.clients === 2}\r\n >\r\n Join\r\n </button>\r\n )}\r\n </td>\r\n </tr>\r\n )\r\n })}\r\n {/* create pagination */}\r\n </tbody>\r\n </Table>\r\n </Col>\r\n </Row>\r\n </Container>\r\n </div>\r\n )\r\n }\r\n\r\n\r\n {/* </>\r\n )} */}\r\n\r\n {/* arena chat */}\r\n <div className='arena-chat-box'>\r\n <button\r\n className='rpgui-button golden'\r\n type='button'\r\n onClick={() => setToggleChatbox(!toggleChatbox)}\r\n >\r\n ChatBox\r\n </button>\r\n <textarea\r\n className='arena-chat-textarea'\r\n style={{ '--visible': toggleChatbox ? 'block' : 'none' } as unknown}\r\n rows={6}\r\n cols={100}\r\n value={arenaChatMsgs}\r\n ></textarea>\r\n </div>\r\n <div className='arena-chat-controls'>\r\n <input\r\n onChange={(e) => setArenaChatInput(e.target?.value)}\r\n type='text'\r\n name='arenaChatInput'\r\n placeholder='message'\r\n value={arenaChatInput}\r\n />\r\n <button className='rpgui-button' type='button' onClick={() => sendMsg()}>\r\n Send\r\n </button>\r\n </div>\r\n </>\r\n )\r\n}\r\n\r\nexport default Arena\r\n","/home/aki/Documents/Lokian.eth/src/components/dojo/mySparringMons.tsx",["340","341"],"import React from 'react'\r\nimport { nameDiv, imgDiv, statDiv } from '../common'\r\nimport { Lokimon } from '../../models'\r\n\r\nconst MySparringMons = ({ mons, setFightChoiceFunc, account, choice }) => {\r\n const yourLokimonsCond = (mon: Lokimon) =>\r\n (mon.owner.toString().toLowerCase() === account?.toString()?.toLowerCase() && !mon.forSale) ||\r\n (mon.sharedTo.toString().toLowerCase() === account?.toString()?.toLowerCase() &&\r\n mon.owner.toString().toLowerCase() !== account?.toString()?.toLowerCase())\r\n\r\n const opponentCond = (mon: Lokimon) => !mon.forSale && mon.sharedTo.toLowerCase() !== account?.toString().toLowerCase()\r\n \r\n const cond = choice === '1' ? yourLokimonsCond : opponentCond\r\n\r\n return (\r\n <>\r\n {mons &&\r\n mons.filter(cond).map((mon: Lokimon) => (\r\n <React.Fragment key={mon.id}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n <div className=\"fight-choice-div\">\r\n <button\r\n className=\"fight-Choice-btn rpgui-button rpgui-cursor-point\"\r\n type=\"button\"\r\n onClick={() => {\r\n setFightChoiceFunc(mon.id)\r\n }}\r\n >\r\n Choice {choice}\r\n </button>\r\n </div>\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </>\r\n )\r\n}\r\n\r\nexport default MySparringMons\r\n","/home/aki/Documents/Lokian.eth/src/components/common/listRender.js",["342","343"],"import React from 'react'\r\nimport { Button, Col, Dropdown } from 'react-bootstrap'\r\nimport ListIcon from '../common/listIcon'\r\nimport GridIcon from '../common/gridIcon'\r\nimport './common.css'\r\n\r\nconst ListRender = ({ pageName, onSetDisplay, onSetOrder }) => {\r\n return (\r\n <div className=\"list-render\">\r\n <div>\r\n <Col xs sm={6} md={12}>\r\n <div className=\"p1 p1-for-centering green-glow\">{pageName}</div>\r\n </Col>\r\n <Col\r\n xs\r\n sm={6}\r\n md={12}\r\n className={\r\n pageName === 'My LokiMons' || pageName === 'My Shop' || pageName === 'Marketplace'\r\n ? 'col-for-mylokimons'\r\n : 'col-for-centering'\r\n }\r\n >\r\n <Button\r\n className=\"display-style-btn\"\r\n variant=\"outline-dark\"\r\n onClick={() => {\r\n if (onSetDisplay) {\r\n onSetDisplay('list')\r\n }\r\n }}\r\n >\r\n <ListIcon />\r\n </Button>\r\n <Button\r\n className=\"display-style-btn\"\r\n variant=\"outline-dark\"\r\n onClick={() => {\r\n if (onSetDisplay) {\r\n onSetDisplay('grid')\r\n }\r\n }}\r\n >\r\n <GridIcon />\r\n </Button>\r\n <Dropdown\r\n className=\"order-dropdown\"\r\n onSelect={(evtK, e) => {\r\n if (onSetOrder) onSetOrder(evtK, e)\r\n }}\r\n >\r\n <Dropdown.Toggle variant=\"secondary\" id=\"dropdown-basic\">\r\n Order\r\n </Dropdown.Toggle>\r\n\r\n <Dropdown.Menu>\r\n {pageName === 'My LokiMons' && (\r\n <>\r\n <Dropdown.Item eventKey=\"nameAZ\">By Name A-Z</Dropdown.Item>\r\n <Dropdown.Item eventKey=\"nameZA\">By Name Z-A</Dropdown.Item>\r\n </>\r\n )}\r\n {(pageName === 'Marketplace' || pageName === 'My Shop') && (\r\n <>\r\n <Dropdown.Item eventKey=\"priceDesc\">By Price High-Low</Dropdown.Item>\r\n <Dropdown.Item eventKey=\"priceAsc\">By Price Low-High</Dropdown.Item>\r\n </>\r\n )}\r\n\r\n <Dropdown.Item eventKey=\"idDesc\">By ID Descending</Dropdown.Item>\r\n <Dropdown.Item eventKey=\"idAsc\">By ID Ascending</Dropdown.Item>\r\n </Dropdown.Menu>\r\n </Dropdown>\r\n </Col>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ListRender\r\n","/home/aki/Documents/Lokian.eth/src/components/common/getMonsOrder.ts",["344"],"import { formatUnits } from '@ethersproject/units'\r\nimport { monName } from '.'\r\nimport { Lokimon } from '../../models'\r\n\r\nconst getMonsOrder = (_orderBy: string, _myLokimons: Lokimon[]) => {\r\n if (!_orderBy) return\r\n\r\n const lokimons = _myLokimons\r\n\r\n switch (_orderBy) {\r\n case 'nameAZ':\r\n lokimons.sort((a, b) => {\r\n const speciesA1 = monName(a.species).toLowerCase()\r\n const speciesB1 = monName(b.species).toLowerCase()\r\n if (speciesA1 == speciesB1) return 0\r\n return speciesA1 < speciesB1 ? -1 : 1\r\n })\r\n break\r\n case 'nameZA':\r\n lokimons.sort((a, b) => {\r\n const speciesA2 = monName(a.species).toLowerCase()\r\n const speciesB2 = monName(b.species).toLowerCase()\r\n if (speciesA2 == speciesB2) return 0\r\n return speciesB2 < speciesA2 ? -1 : 1\r\n })\r\n break\r\n case 'idDesc':\r\n lokimons.sort((a, b) => b.id - a.id)\r\n break\r\n case 'idAsc':\r\n lokimons.sort((a, b) => a.id - b.id)\r\n break\r\n case 'priceDesc':\r\n lokimons.sort((a, b) => parseFloat(formatUnits(b.price, 18)) - parseFloat(formatUnits(a.price, 18)))\r\n break\r\n case 'priceAsc':\r\n lokimons.sort((a, b) => parseFloat(formatUnits(a.price, 18)) - parseFloat(formatUnits(b.price, 18)))\r\n break\r\n default:\r\n lokimons.sort((a, b) => {\r\n const speciesA3 = monName(a.species).toLowerCase()\r\n const speciesB3 = monName(b.species).toLowerCase()\r\n if (speciesA3 == speciesB3) return 0\r\n return speciesA3 < speciesB3 ? -1 : 1\r\n })\r\n break\r\n }\r\n\r\n return lokimons\r\n}\r\n\r\nexport default getMonsOrder\r\n","/home/aki/Documents/Lokian.eth/src/components/arena/myFightingMons.tsx",["345","346"],"import React from 'react'\r\nimport { nameDiv, imgDiv, statDiv } from '../common'\r\nimport { Lokimon } from '../../models'\r\n\r\nconst MyFightingMons = ({ mons, setFightChoiceFunc, account, choice }) => {\r\n const cond = (mon: Lokimon) =>\r\n (mon?.owner === account && !mon?.forSale) || (mon?.sharedTo === account && mon?.owner !== account)\r\n\r\n return (\r\n <>\r\n {mons &&\r\n mons.filter(cond).map((mon: Lokimon) => (\r\n <React.Fragment key={'my-fighting-mons-' + mon?.id || '-'}>\r\n <div className=\"mon\">\r\n <figure className=\"my-figure\">\r\n {nameDiv(mon)}\r\n {imgDiv(mon)}\r\n <figcaption>{statDiv(mon)}</figcaption>\r\n </figure>\r\n <div className=\"fight-choice-div\">\r\n <button\r\n className=\"fight-Choice-btn rpgui-button rpgui-cursor-point\"\r\n type=\"button\"\r\n onClick={() => {\r\n setFightChoiceFunc(mon?.id)\r\n }}\r\n >\r\n Choice {choice}\r\n </button>\r\n </div>\r\n </div>\r\n </React.Fragment>\r\n ))}\r\n </>\r\n )\r\n}\r\n\r\nexport default MyFightingMons\r\n","/home/aki/Documents/Lokian.eth/src/components/token/nftItem.tsx",["347","348"],"import { Row } from 'react-bootstrap'\r\nimport { BigNumber } from '@ethersproject/bignumber'\r\nimport './token.css'\r\nimport React from 'react'\r\n\r\nconst NftItem = ({ item, icon, slot }) => {\r\n const nftItem = BigNumber.from(item).toBigInt()\r\n return (\r\n <>\r\n <Row>\r\n <div className=\"nft-item\">\r\n <div className={`rpgui-icon ${nftItem ? icon : slot}`}></div>\r\n <span>X</span>\r\n <span className=\"nft-item-count\">{`${nftItem}`}</span>\r\n </div>\r\n </Row>\r\n </>\r\n )\r\n}\r\n\r\nexport default NftItem\r\n","/home/aki/Documents/Lokian.eth/src/components/arena/room.tsx",["349","350","351","352"],"/* eslint-disable no-case-declarations */\r\nimport React, { useEffect, useState } from 'react'\r\n// import { \r\n// useNavigate, \r\n// Navigate \r\n// } from 'react-router-dom'\r\nimport { Container, Row, Col } from 'react-bootstrap'\r\nimport { Lokimon } from '../../models'\r\nimport MyFightingMons from './myFightingMons'\r\nimport { breedOption } from '../common'\r\nimport getAccount from '../../utils/getAccount'\r\nimport GenericModal from '../common/genericModal'\r\nimport { toast } from 'react-toastify'\r\nimport { toastErrParams } from '../../utils/toastErrParams'\r\nimport { getFirst7AndLast4CharOfAcct } from '.'\r\nimport { RoomType } from '../common/interfaces'\r\n// import { useFight } from '../../app-functions'\r\n// import { useWs } from './index'\r\n// import { waitForWsConnection } from '../../utils'\r\n\r\ninterface Ready {\r\n monSelectedId?: string | number\r\n otherPlayer?: string\r\n room?: RoomType\r\n creator?: string\r\n playerType?: string\r\n account?: string\r\n}\r\n\r\ninterface Player {\r\n monSelectedId?: string | number\r\n account?: string\r\n playerType?: string\r\n}\r\n\r\n/**\r\n * Room UI\r\n *\r\n * @param {Object} props\r\n * @param {Object} props.room\r\n */\r\nconst Room = ({\r\n room,\r\n onDisconnect,\r\n account,\r\n fightChoice1,\r\n fightChoice2,\r\n monNames,\r\n cryptomons,\r\n setFightChoice2Func,\r\n setFightChoice1Func,\r\n // isDisbanded,\r\n ws,\r\n // onOtherPlayerReady,\r\n // acceptedAndReadyPlayer,\r\n // readyToStart,\r\n mainContract,\r\n}) => {\r\n // const navigate = useNavigate()\r\n // const { ws } = useWs()\r\n\r\n const [otherPlayer, setOtherPlayer] = useState<string>(null)\r\n const [otherPlayerMons, setOtherPlayerMons] = useState<Lokimon[]>(null)\r\n const [creatorMons, setCreatorMons] = useState<Lokimon[]>(null)\r\n const [_account, setAccount] = useState<string>(account)\r\n\r\n useEffect(() => {\r\n let mounted = true\r\n if (!account && mounted) {\r\n ;(async () => {\r\n const acct = await getAccount()\r\n setAccount(acct)\r\n })()\r\n }\r\n\r\n return () => {\r\n mounted = false\r\n }\r\n }, [account])\r\n\r\n useEffect(() => {\r\n if (!room || !room.players) return\r\n const _otherPlayer = room.players.find((player: string) => player !== room.creator)\r\n setOtherPlayer(_otherPlayer)\r\n }, [room])\r\n\r\n useEffect(() => {\r\n if (!cryptomons || !otherPlayer || !room?.creator) return\r\n const _otherPlayerMons = cryptomons.filter((mon: Lokimon) => otherPlayer === mon.owner)\r\n\r\n setOtherPlayerMons(_otherPlayerMons)\r\n setCreatorMons(cryptomons.filter((mon: Lokimon) => room.creator === mon.owner))\r\n }, [cryptomons, otherPlayer, room?.creator])\r\n\r\n const [show, setShow] = useState(false)\r\n const [disconConfirm, setDisconConfirm] = useState(false)\r\n // const [otherPlayerReady, setOtherPlayerReady] = useState(false)\r\n const [disableBtn, setDisableBtn] = useState(false)\r\n\r\n const [readyToStart, setReadyToStart] = useState('ready')\r\n\r\n const [fightPlayersData, setFightPlayersData] = useState([])\r\n\r\n const handleClose = (state: boolean) => {\r\n setShow(false)\r\n setDisconConfirm(state)\r\n }\r\n const handleShow = () => {\r\n setShow(true)\r\n }\r\n\r\n const handlePlayerReady = () => {\r\n const playerType = _account === room?.creator ? 'creator' : 'otherPlayer'\r\n const acc = _account === room?.creator ? room?.creator : otherPlayer\r\n\r\n const paramObj: Ready = {\r\n room,\r\n otherPlayer,\r\n playerType,\r\n creator: room?.creator,\r\n account: acc,\r\n monSelectedId: fightChoice2 || fightChoice1,\r\n }\r\n\r\n const obj = { type: 'ready', params: paramObj }\r\n if (ws) {\r\n ws.send(JSON.stringify(obj))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n if (!ws) return\r\n\r\n ws.onmessage = function incoming(data) {\r\n if (!data || !data.data) return\r\n const parsed = JSON.parse(data.data)\r\n\r\n switch (parsed?.type) {\r\n case 'leave':\r\n console.log('room leave data', parsed)\r\n if (parsed?.params?.room === room?.room) {\r\n // if (parsed?.params?.isClosed && _account === otherPlayer) {\r\n // onDisconnect(null)\r\n\r\n toast.error(\r\n parsed?.params?.isClosed\r\n ? 'Room owner disconnected at room ' + parsed?.params?.room\r\n : getFirst7AndLast4CharOfAcct(parsed?.params?.leaver) +\r\n ' disconnected at room ' +\r\n parsed?.params?.room,\r\n toastErrParams,\r\n )\r\n\r\n const roomToLeave = { ...room }\r\n roomToLeave['leaver'] = getFirst7AndLast4CharOfAcct(_account)\r\n roomToLeave['isOtherPlayer'] = _account === otherPlayer\r\n onDisconnect(roomToLeave)\r\n\r\n // navigate('/arena', {\r\n // state: { roomCode: parsed.params?.room , isDisbandedAndOtherPlayer: true },\r\n // })\r\n // }\r\n }\r\n break\r\n case 'ready':\r\n if (!parsed || !parsed.params) return\r\n console.log('inside room,', parsed)\r\n\r\n // filter readyPlayersData room data to 2, one for creator one for other player\r\n const _readyPlayersData = parsed.params?.readyPlayersData[parsed.params.room?.room] || []\r\n \r\n const uniquePlayersData = [...new Set(_readyPlayersData.map(item => item.playerType))]\r\n console.log(uniquePlayersData);\r\n\r\n const newReadyPlayersData = [\r\n ...new Map(_readyPlayersData.map((item) => [item['playerType'], item])).values(),\r\n ]\r\n console.log(newReadyPlayersData)\r\n\r\n \r\n\r\n if (parsed?.params?.creator === account || parsed?.params?.creator === _account) {\r\n if (newReadyPlayersData?.length === 2) {\r\n setFightPlayersData(newReadyPlayersData)\r\n setReadyToStart('start fight')\r\n } else {\r\n setReadyToStart('waiting for other player')\r\n }\r\n }\r\n\r\n if (\r\n parsed?.params?.otherPlayer === account ||\r\n parsed?.params?.otherPlayer === _account\r\n ) {\r\n setReadyToStart('ready')\r\n }\r\n\r\n break\r\n\r\n case 'fight':\r\n if (parsed?.params) {\r\n console.log('fight func parsed results ', parsed)\r\n\r\n // run fight function here, fight func to call fight func at blockchain\r\n // e.g. fight(parsed.params[0].monSelectedId, arsed.params[1].monSelectedId)\r\n } else {\r\n console.log('no fight players data returned')\r\n }\r\n break\r\n }\r\n }\r\n }, [ws, ws.onmessage])\r\n\r\n useEffect(() => {\r\n if (!disconConfirm || !ws) return\r\n\r\n const roomToLeave = { ...room }\r\n roomToLeave['leaver'] = _account\r\n roomToLeave['isOtherPlayer'] = _account === otherPlayer\r\n\r\n onDisconnect(roomToLeave)\r\n }, [disconConfirm])\r\n\r\n const genericModalProps = {\r\n show,\r\n handleClose: (state: boolean) => handleClose(state),\r\n title: 'Disconnect',\r\n content: 'Are you sure ? This room will be disbanded or disconnected.',\r\n }\r\n\r\nconst [roomFightStatus, setRoomFightStatus] = useState('ongoing')\r\nconst [disableRoomFightBtn, setDisableRoomFightBtn] = useState(false)\r\n\r\n async function roomFight(id1: string | number, id2: string | number, contr) {\r\n setDisableRoomFightBtn(true)\r\n if (id1 === null || id2 === null) {\r\n return\r\n }\r\n const overrides = {\r\n gasLimit: 120000,\r\n }\r\n try {\r\n const tx = await contr?.fight(id1, id2, overrides)?.catch((err) => {\r\n console.log('Fight error, ', err?.toString())\r\n setDisableRoomFightBtn(false)\r\n setRoomFightStatus('done')\r\n })\r\n const recpt = await tx?.wait()\r\n if (recpt && recpt.status) {\r\n setRoomFightStatus('done')\r\n }\r\n\r\n if (recpt && !recpt.status) {\r\n toast.error(`Error, Tx hash: ${recpt.transactionHash}`, toastErrParams)\r\n setRoomFightStatus('done')\r\n }\r\n } catch (error) {\r\n toast.error(`Fight function error: ${error.data?.message || ''}`, toastErrParams)\r\n setRoomFightStatus('done')\r\n setDisableRoomFightBtn(false)\r\n }\r\n }\r\n\r\n const handleFightStart = () => {\r\n console.log('start fight, get choices to fight func in contract')\r\n setDisableBtn(false)\r\n\r\n if (fightPlayersData.length && mainContract) {\r\n\r\n const creatorData: Player = fightPlayersData.filter(playerData => playerData.playerType === 'creator')[0]\r\n const otherPlayerData: Player = fightPlayersData.filter(playerData => playerData.playerType === 'otherPlayer')[0]\r\n \r\n roomFight(creatorData.monSelectedId, otherPlayerData.monSelectedId, mainContract)\r\n\r\n } else {\r\n toast.error('Cannot start fight, Players data not found', toastErrParams)\r\n }\r\n\r\n // const paramObj: Ready = {\r\n // room, creator: room.creator || _account , monSelectedId: fightChoice1\r\n // }\r\n\r\n // if (ws) {\r\n // ws.send(\r\n // JSON.stringify({\r\n // type: 'fight',\r\n // params: {},\r\n // }),\r\n // )\r\n // }\r\n }\r\n\r\n return (\r\n <div className='room-container'>\r\n <div className='p1-arena green-glow'>Room {room?.room}</div>\r\n <GenericModal {...genericModalProps} />\r\n <div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'center' }}>\r\n <button\r\n disabled={disableBtn}\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() => handleShow()}\r\n >\r\n {room?.creator === account ? 'Disband' : 'Disconnect'}\r\n </button>\r\n\r\n {/* {_account === otherPlayer && ( */}\r\n <button\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() => {\r\n\r\n if (readyToStart === 'start fight') {\r\n console.log('start')\r\n handleFightStart()\r\n } else {\r\n if (fightChoice1 || fightChoice2) {\r\n handlePlayerReady()\r\n } else {\r\n toast.warn('Please select a Lokimon', toastErrParams)\r\n }\r\n }\r\n }}\r\n >\r\n {/* {otherPlayerReady ? 'Waiting for start' : 'Ready'} */}\r\n {readyToStart || 'ready'}\r\n </button>\r\n {/* )} */}\r\n\r\n {/* {_account === room?.creator && readyToStart === 'start fight' && (\r\n <button\r\n className='rpgui-button'\r\n type='button'\r\n onClick={() => {\r\n console.log('start or wait')\r\n handleFightStart()\r\n }}\r\n >\r\n Start fight!\r\n </button> \r\n )} */}\r\n </div>\r\n\r\n {/* upper isle */}\r\n <div className='rpgui-container framed-grey vs-container' style={{ marginTop: '24px' }}>\r\n <Container fluid>\r\n <Row>\r\n <Col xs md='12' className='col-text-center'>\r\n Selected Lokimon\r\n </Col>\r\n <Col xs='12' lg='12' className='col-text-center'>\r\n <span>\r\n {\r\n monNames[\r\n cryptomons.find(\r\n (mon: Lokimon) => mon.id?.toString() === fightChoice1?.toString(),\r\n )?.species\r\n ]\r\n }{' '}\r\n {fightChoice1 ? `no.${fightChoice1}` : fightChoice1 == '0' ? `no.${0}` : ''}\r\n </span>\r\n </Col>\r\n <Col xs='12' lg='12' className='col-text-center'>\r\n <span>\r\n {\r\n monNames[\r\n cryptomons.find(\r\n (mon: Lokimon) => mon.id?.toString() === fightChoice2?.toString(),\r\n )?.species\r\n ]\r\n }{' '}\r\n {fightChoice2 ? `no.${fightChoice2}` : ''}\r\n </span>\r\n </Col>\r\n </Row>\r\n <div className='dojo-spar-mons-img'>\r\n {breedOption(parseInt(fightChoice1), cryptomons)}\r\n {breedOption(parseInt(fightChoice2), cryptomons)}\r\n </div>\r\n </Container>\r\n </div>\r\n\r\n {/* fight mons area, fight against area */}\r\n\r\n {_account === room?.creator && (\r\n <div className='rpgui-container framed-grey table-container'>\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Player 1 Select</div>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col xs md={12}>\r\n <div className='dojo-selection'>\r\n <MyFightingMons\r\n mons={creatorMons}\r\n setFightChoiceFunc={setFightChoice1Func}\r\n account={room?.creator}\r\n choice='1'\r\n />\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n )}\r\n\r\n {_account === otherPlayer && (\r\n <div className='rpgui-container framed-grey table-container'>\r\n <Row>\r\n <Col xs md={12}>\r\n <div style={{ textAlign: 'center' }}>Player 2 Select</div>\r\n </Col>\r\n </Row>\r\n <Row>\r\n <Col xs md={12}>\r\n <div className='dojo-selection'>\r\n <MyFightingMons\r\n mons={otherPlayerMons}\r\n setFightChoiceFunc={setFightChoice2Func}\r\n account={otherPlayer}\r\n choice='2'\r\n />\r\n </div>\r\n </Col>\r\n </Row>\r\n </div>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nexport default Room\r\n","/home/aki/Documents/Lokian.eth/src/components/common/listIcon.tsx",["353"],"import React from 'react'\r\n\r\nconst ListIcon = () => {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n fill=\"currentColor\"\r\n className=\"bi bi-list-ul\"\r\n viewBox=\"0 0 16 16\"\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm-3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2z\"\r\n />\r\n </svg>\r\n )\r\n}\r\n\r\nexport default ListIcon\r\n","/home/aki/Documents/Lokian.eth/src/components/common/gridIcon.tsx",["354"],"import React from 'react'\r\n\r\nconst GridIcon = () => {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"16\"\r\n height=\"16\"\r\n fill=\"currentColor\"\r\n className=\"bi bi-grid\"\r\n viewBox=\"0 0 16 16\"\r\n >\r\n <path d=\"M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z\" />\r\n </svg>\r\n )\r\n}\r\n\r\nexport default GridIcon\r\n","/home/aki/Documents/Lokian.eth/src/components/common/genericModal.tsx",["355","356"],"import React from 'react';\r\nimport { Modal, Button } from 'react-bootstrap';\r\n\r\nfunction GenericModal({ show, handleClose, title, content }) {\r\n return (\r\n <>\r\n <Modal className='generic-modal' show={show} onHide={() => handleClose(false)}>\r\n <Modal.Header closeButton>\r\n <Modal.Title>{title}</Modal.Title>\r\n </Modal.Header>\r\n <Modal.Body>{content}</Modal.Body>\r\n <Modal.Footer>\r\n <Button variant=\"primary\" onClick={() => handleClose(true)}>\r\n Confirm\r\n </Button>\r\n <Button variant=\"secondary\" onClick={() => handleClose(false)}>\r\n Cancel\r\n </Button>\r\n </Modal.Footer>\r\n </Modal>\r\n </>\r\n );\r\n}\r\n\r\nexport default GenericModal","/home/aki/Documents/Lokian.eth/src/sprites-copy/index.js",[],"/home/aki/Documents/Lokian.eth/src/ErrorBoundary.tsx",[],{"ruleId":"357","severity":1,"message":"358","line":6,"column":8,"nodeType":"359","messageId":"360","endLine":6,"endColumn":34},{"ruleId":"357","severity":1,"message":"358","line":33,"column":10,"nodeType":"359","messageId":"360","endLine":33,"endColumn":56},{"ruleId":"361","severity":1,"message":"362","line":37,"column":38,"nodeType":"363","messageId":"364","endLine":37,"endColumn":41,"suggestions":"365"},{"ruleId":"357","severity":1,"message":"358","line":181,"column":24,"nodeType":"366","messageId":"360","endLine":181,"endColumn":43},{"ruleId":"357","severity":1,"message":"358","line":183,"column":24,"nodeType":"366","messageId":"360","endLine":183,"endColumn":41},{"ruleId":"357","severity":1,"message":"358","line":195,"column":24,"nodeType":"366","messageId":"360","endLine":195,"endColumn":33},{"ruleId":"357","severity":1,"message":"367","line":195,"column":25,"nodeType":"368","messageId":"369","endLine":195,"endColumn":29},{"ruleId":"357","severity":1,"message":"358","line":201,"column":23,"nodeType":"366","messageId":"360","endLine":201,"endColumn":40},{"ruleId":"357","severity":1,"message":"358","line":216,"column":24,"nodeType":"366","messageId":"360","endLine":216,"endColumn":41},{"ruleId":"357","severity":1,"message":"358","line":240,"column":30,"nodeType":"366","messageId":"360","endLine":240,"endColumn":114},{"ruleId":"357","severity":1,"message":"370","line":240,"column":60,"nodeType":"368","messageId":"369","endLine":240,"endColumn":77},{"ruleId":"357","severity":1,"message":"371","line":240,"column":79,"nodeType":"368","messageId":"369","endLine":240,"endColumn":98},{"ruleId":"357","severity":1,"message":"372","line":240,"column":100,"nodeType":"368","messageId":"369","endLine":240,"endColumn":110},{"ruleId":"357","severity":1,"message":"358","line":259,"column":34,"nodeType":"366","messageId":"360","endLine":259,"endColumn":101},{"ruleId":"357","severity":1,"message":"373","line":259,"column":83,"nodeType":"368","messageId":"369","endLine":259,"endColumn":97},{"ruleId":"357","severity":1,"message":"358","line":282,"column":23,"nodeType":"366","messageId":"360","endLine":282,"endColumn":65},{"ruleId":"357","severity":1,"message":"374","line":282,"column":38,"nodeType":"368","messageId":"369","endLine":282,"endColumn":53},{"ruleId":"357","severity":1,"message":"375","line":282,"column":55,"nodeType":"368","messageId":"369","endLine":282,"endColumn":61},{"ruleId":"357","severity":1,"message":"358","line":310,"column":25,"nodeType":"366","messageId":"360","endLine":310,"endColumn":84},{"ruleId":"357","severity":1,"message":"376","line":310,"column":40,"nodeType":"368","messageId":"369","endLine":310,"endColumn":59},{"ruleId":"357","severity":1,"message":"377","line":310,"column":61,"nodeType":"368","messageId":"369","endLine":310,"endColumn":80},{"ruleId":"357","severity":1,"message":"358","line":337,"column":28,"nodeType":"366","messageId":"360","endLine":337,"endColumn":67},{"ruleId":"357","severity":1,"message":"358","line":4,"column":8,"nodeType":"359","messageId":"360","endLine":4,"endColumn":26},{"ruleId":"357","severity":1,"message":"358","line":8,"column":25,"nodeType":"366","messageId":"360","endLine":13,"endColumn":5},{"ruleId":"357","severity":1,"message":"358","line":3,"column":1,"nodeType":"359","messageId":"360","endLine":3,"endColumn":73},{"ruleId":"357","severity":1,"message":"378","line":3,"column":20,"nodeType":"368","messageId":"369","endLine":3,"endColumn":25},{"ruleId":"357","severity":1,"message":"379","line":3,"column":27,"nodeType":"368","messageId":"369","endLine":3,"endColumn":36},{"ruleId":"357","severity":1,"message":"380","line":3,"column":38,"nodeType":"368","messageId":"369","endLine":3,"endColumn":52},{"ruleId":"357","severity":1,"message":"358","line":3,"column":1,"nodeType":"359","messageId":"360","endLine":3,"endColumn":54},{"ruleId":"357","severity":1,"message":"378","line":3,"column":17,"nodeType":"368","messageId":"369","endLine":3,"endColumn":22},{"ruleId":"357","severity":1,"message":"379","line":3,"column":24,"nodeType":"368","messageId":"369","endLine":3,"endColumn":33},{"ruleId":"357","severity":1,"message":"381","line":12,"column":45,"nodeType":"368","messageId":"382","endLine":12,"endColumn":58},{"ruleId":"357","severity":1,"message":"358","line":7,"column":27,"nodeType":"366","messageId":"360","endLine":7,"endColumn":98},{"ruleId":"357","severity":1,"message":"383","line":7,"column":28,"nodeType":"384","messageId":"385","endLine":7,"endColumn":94},{"ruleId":"357","severity":1,"message":"358","line":3,"column":31,"nodeType":"366","messageId":"360","endLine":3,"endColumn":62},{"ruleId":"357","severity":1,"message":"383","line":3,"column":32,"nodeType":"384","messageId":"385","endLine":3,"endColumn":58},{"ruleId":"357","severity":1,"message":"358","line":7,"column":25,"nodeType":"366","messageId":"360","endLine":7,"endColumn":69},{"ruleId":"357","severity":1,"message":"383","line":7,"column":26,"nodeType":"384","messageId":"385","endLine":7,"endColumn":65},{"ruleId":"357","severity":1,"message":"358","line":5,"column":8,"nodeType":"359","messageId":"360","endLine":5,"endColumn":50},{"ruleId":"357","severity":1,"message":"386","line":5,"column":31,"nodeType":"368","messageId":"369","endLine":5,"endColumn":39},{"ruleId":"357","severity":1,"message":"387","line":5,"column":41,"nodeType":"368","messageId":"369","endLine":5,"endColumn":49},{"ruleId":"357","severity":1,"message":"358","line":4,"column":1,"nodeType":"359","messageId":"360","endLine":4,"endColumn":33},{"ruleId":"357","severity":1,"message":"383","line":4,"column":18,"nodeType":"384","messageId":"385","endLine":4,"endColumn":32},{"ruleId":"357","severity":1,"message":"358","line":4,"column":17,"nodeType":"366","messageId":"360","endLine":4,"endColumn":40},{"ruleId":"357","severity":1,"message":"383","line":4,"column":18,"nodeType":"384","messageId":"385","endLine":4,"endColumn":36},{"ruleId":"357","severity":1,"message":"358","line":27,"column":14,"nodeType":"366","messageId":"360","endLine":27,"endColumn":33},{"ruleId":"357","severity":1,"message":"358","line":8,"column":20,"nodeType":"366","messageId":"360","endLine":8,"endColumn":76},{"ruleId":"357","severity":1,"message":"383","line":8,"column":21,"nodeType":"384","messageId":"385","endLine":8,"endColumn":72},{"ruleId":"357","severity":1,"message":"358","line":9,"column":15,"nodeType":"366","messageId":"360","endLine":14,"endColumn":6},{"ruleId":"357","severity":1,"message":"383","line":9,"column":16,"nodeType":"384","messageId":"385","endLine":14,"endColumn":2},{"ruleId":"357","severity":1,"message":"358","line":9,"column":15,"nodeType":"366","messageId":"360","endLine":9,"endColumn":67},{"ruleId":"357","severity":1,"message":"383","line":9,"column":16,"nodeType":"384","messageId":"385","endLine":9,"endColumn":63},{"ruleId":"357","severity":1,"message":"358","line":14,"column":21,"nodeType":"366","messageId":"360","endLine":14,"endColumn":84},{"ruleId":"357","severity":1,"message":"383","line":14,"column":22,"nodeType":"384","messageId":"385","endLine":14,"endColumn":80},{"ruleId":"357","severity":1,"message":"358","line":13,"column":16,"nodeType":"366","messageId":"360","endLine":13,"endColumn":76},{"ruleId":"357","severity":1,"message":"383","line":13,"column":17,"nodeType":"384","messageId":"385","endLine":13,"endColumn":72},{"ruleId":"357","severity":1,"message":"358","line":12,"column":20,"nodeType":"366","messageId":"360","endLine":12,"endColumn":64},{"ruleId":"357","severity":1,"message":"383","line":12,"column":21,"nodeType":"384","messageId":"385","endLine":12,"endColumn":60},{"ruleId":"357","severity":1,"message":"358","line":9,"column":15,"nodeType":"366","messageId":"360","endLine":9,"endColumn":59},{"ruleId":"357","severity":1,"message":"383","line":9,"column":16,"nodeType":"384","messageId":"385","endLine":9,"endColumn":55},{"ruleId":"357","severity":1,"message":"358","line":12,"column":23,"nodeType":"366","messageId":"360","endLine":20,"endColumn":6},{"ruleId":"357","severity":1,"message":"383","line":12,"column":24,"nodeType":"384","messageId":"385","endLine":20,"endColumn":2},{"ruleId":"388","severity":1,"message":"389","line":22,"column":21,"nodeType":"368","messageId":"390","endLine":22,"endColumn":31},{"ruleId":"361","severity":1,"message":"362","line":37,"column":54,"nodeType":"363","messageId":"364","endLine":37,"endColumn":57,"suggestions":"391"},{"ruleId":"388","severity":1,"message":"392","line":24,"column":10,"nodeType":"368","messageId":"390","endLine":24,"endColumn":15},{"ruleId":"357","severity":1,"message":"358","line":42,"column":22,"nodeType":"366","messageId":"360","endLine":42,"endColumn":27},{"ruleId":"357","severity":1,"message":"358","line":46,"column":15,"nodeType":"366","messageId":"360","endLine":55,"endColumn":6},{"ruleId":"357","severity":1,"message":"383","line":46,"column":16,"nodeType":"384","messageId":"385","endLine":55,"endColumn":2},{"ruleId":"357","severity":1,"message":"358","line":5,"column":24,"nodeType":"366","messageId":"360","endLine":5,"endColumn":74},{"ruleId":"357","severity":1,"message":"383","line":5,"column":25,"nodeType":"384","messageId":"385","endLine":5,"endColumn":70},{"ruleId":"357","severity":1,"message":"358","line":7,"column":20,"nodeType":"366","messageId":"360","endLine":7,"endColumn":63},{"ruleId":"357","severity":1,"message":"383","line":7,"column":21,"nodeType":"384","messageId":"385","endLine":7,"endColumn":59},{"ruleId":"357","severity":1,"message":"358","line":5,"column":22,"nodeType":"366","messageId":"360","endLine":5,"endColumn":67},{"ruleId":"357","severity":1,"message":"358","line":5,"column":24,"nodeType":"366","messageId":"360","endLine":5,"endColumn":74},{"ruleId":"357","severity":1,"message":"383","line":5,"column":25,"nodeType":"384","messageId":"385","endLine":5,"endColumn":70},{"ruleId":"357","severity":1,"message":"358","line":6,"column":17,"nodeType":"366","messageId":"360","endLine":6,"endColumn":42},{"ruleId":"357","severity":1,"message":"383","line":6,"column":18,"nodeType":"384","messageId":"385","endLine":6,"endColumn":38},{"ruleId":"357","severity":1,"message":"358","line":42,"column":14,"nodeType":"366","messageId":"360","endLine":58,"endColumn":6},{"ruleId":"357","severity":1,"message":"383","line":42,"column":15,"nodeType":"384","messageId":"385","endLine":58,"endColumn":2},{"ruleId":"388","severity":1,"message":"393","line":231,"column":8,"nodeType":"368","messageId":"390","endLine":231,"endColumn":23},{"ruleId":"388","severity":1,"message":"394","line":232,"column":8,"nodeType":"368","messageId":"390","endLine":232,"endColumn":27},{"ruleId":"357","severity":1,"message":"358","line":3,"column":18,"nodeType":"366","messageId":"360","endLine":3,"endColumn":23},{"ruleId":"357","severity":1,"message":"358","line":3,"column":18,"nodeType":"366","messageId":"360","endLine":3,"endColumn":23},{"ruleId":"357","severity":1,"message":"358","line":4,"column":1,"nodeType":"359","messageId":"360","endLine":4,"endColumn":61},{"ruleId":"357","severity":1,"message":"383","line":4,"column":23,"nodeType":"384","messageId":"385","endLine":4,"endColumn":60},"@typescript-eslint/explicit-module-boundary-types","Missing return type on function.","FunctionDeclaration","missingReturnType","@typescript-eslint/no-explicit-any","Unexpected any. Specify a different type.","TSAnyKeyword","unexpectedAny",["395","396"],"ArrowFunctionExpression","Argument 'Type' should be typed.","Identifier","missingArgType","Argument 'handleChangePrice' should be typed.","Argument 'isAddForSaleLoading' should be typed.","Argument 'addForSale' should be typed.","Argument 'removeFromSale' should be typed.","Argument 'isBuyMonLoading' should be typed.","Argument 'buyMon' should be typed.","Argument 'setBreedChoice1Func' should be typed.","Argument 'setBreedChoice2Func' should be typed.","Argument 'recpt' should be typed.","Argument 'toastFunc' should be typed.","Argument 'refreshMonFunc' should be typed.","Argument 'callback' should be typed with a non-any type.","anyTypedArg","Object pattern argument should be typed.","ObjectPattern","missingArgTypeUnnamed","Argument '_library' should be typed.","Argument '_account' should be typed.","@typescript-eslint/no-unused-vars","'setJoining' is assigned a value but never used.","unusedVar",["397","398"],"'start' is defined but never used.","'roomFightStatus' is assigned a value but never used.","'disableRoomFightBtn' is assigned a value but never used.",{"messageId":"399","fix":"400","desc":"401"},{"messageId":"402","fix":"403","desc":"404"},{"messageId":"399","fix":"405","desc":"401"},{"messageId":"402","fix":"406","desc":"404"},"suggestUnknown",{"range":"407","text":"408"},"Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.","suggestNever",{"range":"407","text":"409"},"Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",{"range":"410","text":"408"},{"range":"410","text":"409"},[1032,1035],"unknown","never",[1057,1060]]