-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 15.7 KB
/
.eslintcache
1
[{"/Users/piset/Desktop/test-dapp/src/index.js":"1","/Users/piset/Desktop/test-dapp/src/App.js":"2","/Users/piset/Desktop/test-dapp/src/components/Header.js":"3","/Users/piset/Desktop/test-dapp/src/pages/Home.js":"4","/Users/piset/Desktop/test-dapp/src/pages/Transaction.js":"5","/Users/piset/Desktop/test-dapp/src/pages/CreateAccount.js":"6","/Users/piset/Desktop/test-dapp/src/pages/ImportAccount.js":"7","/Users/piset/Desktop/test-dapp/src/config/index.js":"8","/Users/piset/Desktop/test-dapp/src/substrate-lib/index.js":"9","/Users/piset/Desktop/test-dapp/src/substrate-lib/SubstrateContext.js":"10","/Users/piset/Desktop/test-dapp/src/substrate-lib/utils.js":"11","/Users/piset/Desktop/test-dapp/src/components/AccountLoad.js":"12","/Users/piset/Desktop/test-dapp/src/pages/draft.js":"13"},{"size":389,"mtime":1611477451353,"results":"14","hashOfConfig":"15"},{"size":935,"mtime":1611653028732,"results":"16","hashOfConfig":"15"},{"size":840,"mtime":1611737975491,"results":"17","hashOfConfig":"15"},{"size":655,"mtime":1611557778753,"results":"18","hashOfConfig":"15"},{"size":2924,"mtime":1611912186885,"results":"19","hashOfConfig":"15"},{"size":2487,"mtime":1611315062856,"results":"20","hashOfConfig":"15"},{"size":3947,"mtime":1611555606511,"results":"21","hashOfConfig":"15"},{"size":646,"mtime":1611325747738,"results":"22","hashOfConfig":"15"},{"size":167,"mtime":1611325747983,"results":"23","hashOfConfig":"15"},{"size":4308,"mtime":1611325747920,"results":"24","hashOfConfig":"15"},{"size":210,"mtime":1611325747984,"results":"25","hashOfConfig":"15"},{"size":1350,"mtime":1611558719161,"results":"26","hashOfConfig":"15"},{"size":770,"mtime":1611728753612,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"ps87p2",{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"39","messages":"40","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"41","usedDeprecatedRules":"30"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44","usedDeprecatedRules":"30"},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"55","usedDeprecatedRules":"30"},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"/Users/piset/Desktop/test-dapp/src/index.js",[],["58","59"],"/Users/piset/Desktop/test-dapp/src/App.js",[],"/Users/piset/Desktop/test-dapp/src/components/Header.js",[],"/Users/piset/Desktop/test-dapp/src/pages/Home.js",[],"/Users/piset/Desktop/test-dapp/src/pages/Transaction.js",["60","61","62","63","64","65","66","67","68"],"/Users/piset/Desktop/test-dapp/src/pages/CreateAccount.js",["69","70","71","72","73","74"],"import React, { useState } from 'react';\nimport { mnemonicGenerate, randomAsHex } from '@polkadot/util-crypto';\nimport keyring from '@polkadot/ui-keyring';\n\nimport { Button, Form, Input, Switch } from 'antd';\n\nexport default function CreateAccount() {\n const [isSeed, setIsSeed] = useState(false);\n\n const onChange = () => {\n setIsSeed(!isSeed);\n }\n\n const [name, setName] = useState('');\n const [mnemonic, setMnemo] = useState(mnemonicGenerate());\n const [seed, setSeed] = useState(randomAsHex(32));\n const [password, setPassword] = useState('');\n\n const Create = (val) => {\n const { pair, json } = keyring.addUri(mnemonic, val.password, {name: val.name});\n console.log(pair, json);\n } \n const CreateFromSeed = (val) => {\n const { pair, json } = keyring.addUri(seed, val.password, {name: val.name});\n console.log(pair, json);\n }\n \n return (\n <>\n <div>\n <Switch defaultChecked onChange={onChange} />\n <span>From Mnemonic</span>\n </div>\n <br />\n { isSeed && (\n <div>\n <Form\n onFinish={CreateFromSeed}\n >\n <Form.Item\n label=\"Username\"\n name=\"name\"\n >\n <Input />\n </Form.Item>\n <Form.Item\n label=\"Seed\"\n name=\"seed\"\n >\n <Input placeholder={seed} disabled />\n </Form.Item>\n <Form.Item\n label=\"Password\"\n name=\"password\"\n >\n <Input />\n </Form.Item> \n <Form.Item>\n <Button htmlType=\"submit\" style={{width: '100%'}}>Create</Button>\n </Form.Item>\n </Form>\n </div>\n )}\n { !isSeed && (\n <div>\n <Form\n onFinish={Create}\n >\n <Form.Item\n label=\"Username\"\n name=\"name\"\n >\n <Input />\n </Form.Item>\n <Form.Item\n label=\"Mnemonic seed\"\n name=\"mnemonic\"\n >\n <Input placeholder={mnemonic} disabled />\n </Form.Item>\n <Form.Item\n label=\"Password\"\n name=\"password\"\n >\n <Input />\n </Form.Item> \n <Form.Item>\n <Button htmlType=\"submit\" style={{width: '100%'}}>Create</Button>\n </Form.Item>\n </Form>\n </div>\n )}\n </>\n )\n}","/Users/piset/Desktop/test-dapp/src/pages/ImportAccount.js",["75","76"],"import React, { useState } from 'react';\nimport { Button, Row, Col, Modal, Form, Input, Upload } from 'antd';\nimport { UploadOutlined } from '@ant-design/icons';\nimport keyring from '@polkadot/ui-keyring';\n\nfunction ImportAccount() {\n const [ModalMnemonic, setModalMnemonic] = useState(false);\n const [ModalSeed, setModalSeed] = useState(false);\n const [ModalJson, setModalJson] = useState(false);\n const [file, setFile] = useState();\n const [account, setAccount] = useState();\n\n const Create = (val) => {\n const { pair, json } = keyring.addUri(val.mnemonic, val.password, {name: val.name});\n console.log(pair, json);\n } \n const CreateFromSeed = (val) => {\n const { pair, json } = keyring.addUri(val.seed, val.password, {name: val.name});\n console.log(pair, json);\n }\n\n const CreateFromJson = (val) => {\n const json = JSON.parse(account);\n console.log(json)\n const pair = keyring.restoreAccount(json, val.password);\n console.log(pair)\n }\n\n const beforeUpload = (file) => {\n const reader = new FileReader();\n reader.onload = () => {\n setAccount(reader.result);\n console.log(reader.result)\n };\n reader.readAsText(file);\n return false;\n }\n \n return (\n <div>\n <Row>\n <Col>\n <Button onClick={() => setModalMnemonic(true)}>Import From Mnemonic</Button>\n </Col>\n <Col offset={1}>\n <Button onClick={() => setModalSeed(true)}>Import From Seed</Button>\n </Col>\n <Col style={{marginTop: '20px'}}>\n <Button onClick={() => setModalJson(true)}>Import From Json</Button>\n </Col>\n </Row>\n <div>\n <Modal footer={null} title=\"Import From Mnemonic\" visible={ModalMnemonic} onCancel={() => setModalMnemonic(false)}>\n <Form\n onFinish={Create}\n >\n <Form.Item\n name=\"name\"\n >\n <Input placeholder=\"Username\" />\n </Form.Item>\n <Form.Item\n name=\"mnemonic\"\n >\n <Input placeholder=\"Mnemonic seed\" />\n </Form.Item>\n <Form.Item\n name=\"password\"\n >\n <Input placeholder=\"Password\" />\n </Form.Item> \n <Form.Item>\n <Button htmlType=\"submit\" style={{width: '100%'}}>Create</Button>\n </Form.Item>\n </Form>\n </Modal>\n {/* Seed */}\n <Modal footer={null} title=\"Import From Seed\" visible={ModalSeed} onCancel={() => setModalSeed(false)}>\n <Form\n onFinish={CreateFromSeed}\n >\n <Form.Item\n name=\"name\"\n >\n <Input placeholder=\"Username\" />\n </Form.Item>\n <Form.Item\n name=\"seed\"\n >\n <Input placeholder=\"Seed\" />\n </Form.Item>\n <Form.Item\n name=\"password\"\n >\n <Input placeholder=\"Password\" />\n </Form.Item> \n <Form.Item>\n <Button htmlType=\"submit\" style={{width: '100%'}}>CreateFromSeed</Button>\n </Form.Item>\n </Form>\n </Modal>\n {/* JSON */}\n <Modal footer={null} title=\"Import From JSON\" visible={ModalJson} onCancel={() => setModalJson(false)}>\n <Upload maxCount={1} accept=\"application/json, text/plain\" beforeUpload={beforeUpload}>\n <Button icon={<UploadOutlined />}>Select File</Button>\n </Upload>\n <br />\n <Form\n onFinish={CreateFromJson}\n >\n <Form.Item\n name=\"password\"\n >\n <Input placeholder=\"Password\" />\n </Form.Item> \n <Form.Item>\n <Button htmlType=\"submit\" style={{width: '100%'}}>CreateFromSeed</Button>\n </Form.Item>\n </Form>\n </Modal>\n </div>\n </div>\n )\n}\n\nexport default ImportAccount;\n","/Users/piset/Desktop/test-dapp/src/config/index.js",[],"/Users/piset/Desktop/test-dapp/src/substrate-lib/index.js",[],"/Users/piset/Desktop/test-dapp/src/substrate-lib/SubstrateContext.js",[],"/Users/piset/Desktop/test-dapp/src/substrate-lib/utils.js",[],"/Users/piset/Desktop/test-dapp/src/components/AccountLoad.js",["77"],"import React, { useState, useEffect } from 'react';\nimport { u8aToHex } from \"@polkadot/util\";\nimport { ApiPromise, WsProvider } from '@polkadot/api';\nimport { Link } from 'react-router-dom';\n\nimport { Button, Row, Col } from 'antd';\n\nexport default function AccountLoad({ acc }) {\n const [balanceAvailable, setBalanceAvailable] = useState();\n const [nonce, setNonce] = useState();\n\n const loadBalance = async() => {\n const wsProvider = new WsProvider('wss://rpc-testnet.selendra.org');\n const api = await ApiPromise.create({ provider: wsProvider });\n\n const { nonce, data: balance } = await api.query.system.account(acc.address);\n setBalanceAvailable(balance.free.toHuman());\n setNonce(nonce.toString());\n }\n\n useEffect(() => {\n loadBalance();\n }, [])\n\n return (\n <div>\n {/* name, address, public_key, type, transaction, balance */}\n <p>Name: {acc.meta.name}</p>\n <p>Address: {acc.address}</p>\n <p>Public Key: {u8aToHex(acc.publicKey)}</p>\n <p>Type: {acc.type}</p>\n <p>Transaction: {nonce}</p>\n <p>Balance: {balanceAvailable}</p>\n <br/>\n <Row>\n <Col>\n <Link>\n <Button>Backup Account</Button>\n </Link>\n </Col>\n <Col offset={1}>\n <Button>Change Password</Button>\n </Col>\n </Row>\n <hr/>\n </div>\n )\n}","/Users/piset/Desktop/test-dapp/src/pages/draft.js",[],{"ruleId":"78","replacedBy":"79"},{"ruleId":"80","replacedBy":"81"},{"ruleId":"82","severity":1,"message":"83","line":6,"column":8,"nodeType":"84","messageId":"85","endLine":6,"endColumn":17},{"ruleId":"82","severity":1,"message":"86","line":7,"column":10,"nodeType":"84","messageId":"85","endLine":7,"endColumn":23},{"ruleId":"82","severity":1,"message":"87","line":10,"column":3,"nodeType":"84","messageId":"85","endLine":10,"endColumn":15},{"ruleId":"82","severity":1,"message":"88","line":11,"column":3,"nodeType":"84","messageId":"85","endLine":11,"endColumn":13},{"ruleId":"82","severity":1,"message":"89","line":12,"column":3,"nodeType":"84","messageId":"85","endLine":12,"endColumn":18},{"ruleId":"82","severity":1,"message":"90","line":13,"column":3,"nodeType":"84","messageId":"85","endLine":13,"endColumn":23},{"ruleId":"82","severity":1,"message":"91","line":14,"column":3,"nodeType":"84","messageId":"85","endLine":14,"endColumn":21},{"ruleId":"82","severity":1,"message":"92","line":16,"column":8,"nodeType":"84","messageId":"85","endLine":16,"endColumn":10},{"ruleId":"82","severity":1,"message":"93","line":59,"column":11,"nodeType":"84","messageId":"85","endLine":59,"endColumn":19},{"ruleId":"82","severity":1,"message":"94","line":14,"column":10,"nodeType":"84","messageId":"85","endLine":14,"endColumn":14},{"ruleId":"82","severity":1,"message":"95","line":14,"column":16,"nodeType":"84","messageId":"85","endLine":14,"endColumn":23},{"ruleId":"82","severity":1,"message":"96","line":15,"column":20,"nodeType":"84","messageId":"85","endLine":15,"endColumn":28},{"ruleId":"82","severity":1,"message":"97","line":16,"column":16,"nodeType":"84","messageId":"85","endLine":16,"endColumn":23},{"ruleId":"82","severity":1,"message":"98","line":17,"column":10,"nodeType":"84","messageId":"85","endLine":17,"endColumn":18},{"ruleId":"82","severity":1,"message":"99","line":17,"column":20,"nodeType":"84","messageId":"85","endLine":17,"endColumn":31},{"ruleId":"82","severity":1,"message":"100","line":10,"column":10,"nodeType":"84","messageId":"85","endLine":10,"endColumn":14},{"ruleId":"82","severity":1,"message":"101","line":10,"column":16,"nodeType":"84","messageId":"85","endLine":10,"endColumn":23},{"ruleId":"102","severity":1,"message":"103","line":23,"column":6,"nodeType":"104","endLine":23,"endColumn":8,"suggestions":"105"},"no-native-reassign",["106"],"no-negated-in-lhs",["107"],"no-unused-vars","'BigNumber' is defined but never used.","Identifier","unusedVar","'formatBalance' is defined but never used.","'web3Accounts' is defined but never used.","'web3Enable' is defined but never used.","'web3FromAddress' is defined but never used.","'web3ListRpcProviders' is defined but never used.","'web3UseRpcProvider' is defined but never used.","'BN' is defined but never used.","'transfer' is assigned a value but never used.","'name' is assigned a value but never used.","'setName' is assigned a value but never used.","'setMnemo' is assigned a value but never used.","'setSeed' is assigned a value but never used.","'password' is assigned a value but never used.","'setPassword' is assigned a value but never used.","'file' is assigned a value but never used.","'setFile' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'loadBalance'. Either include it or remove the dependency array.","ArrayExpression",["108"],"no-global-assign","no-unsafe-negation",{"desc":"109","fix":"110"},"Update the dependencies array to be: [loadBalance]",{"range":"111","text":"112"},[773,775],"[loadBalance]"]