├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── testnet-bug.md ├── .gitignore ├── README.md ├── config ├── config.ts ├── defaultSettings.ts └── proxy.ts ├── jest.config.js ├── jsconfig.json ├── mock ├── listTableList.ts ├── notices.ts ├── route.ts └── user.ts ├── package.json ├── public ├── CNAME ├── favicon.ico ├── header.png ├── home_bg.png ├── icons │ ├── icon-128x128.png │ ├── icon-192x192.png │ └── icon-512x512.png ├── logo.svg ├── pro_icon.svg └── stacks_icon.png ├── src ├── access.ts ├── app.tsx ├── assets │ ├── logo.png │ ├── stacks.svg │ └── stacks_icon.png ├── components │ ├── Footer │ │ └── index.tsx │ ├── HeaderDropdown │ │ ├── index.less │ │ └── index.tsx │ ├── HeaderSearch │ │ ├── index.less │ │ └── index.tsx │ ├── NoticeIcon │ │ ├── NoticeIcon.tsx │ │ ├── NoticeList.less │ │ ├── NoticeList.tsx │ │ ├── index.less │ │ └── index.tsx │ ├── PageLoading │ │ └── index.tsx │ └── RightContent │ │ ├── AvatarDropdown.tsx │ │ ├── SwitchNetwork.tsx │ │ ├── index.less │ │ └── index.tsx ├── global.less ├── global.tsx ├── locales │ ├── en-US.ts │ ├── en-US │ │ ├── component.ts │ │ ├── globalHeader.ts │ │ ├── menu.ts │ │ ├── pwa.ts │ │ ├── settingDrawer.ts │ │ └── settings.ts │ ├── zh-CN.ts │ └── zh-CN │ │ ├── component.ts │ │ ├── globalHeader.ts │ │ ├── menu.ts │ │ ├── pwa.ts │ │ ├── settingDrawer.ts │ │ └── settings.ts ├── manifest.json ├── models │ └── networkModel.ts ├── pages │ ├── 404.tsx │ ├── client │ │ ├── component │ │ │ ├── AccountForm.tsx │ │ │ ├── AuthCode.tsx │ │ │ ├── BlockInfoTable.tsx │ │ │ ├── ChainSyncInfoTable.tsx │ │ │ ├── MinerInfoTable.tsx │ │ │ ├── MiningInfoTable.tsx │ │ │ ├── OperationBoard.tsx │ │ │ ├── Step1AccountContent.tsx │ │ │ ├── Step2BurnFeeContent.tsx │ │ │ └── Step3NodeInfoContent.tsx │ │ ├── index.tsx │ │ ├── locales │ │ │ ├── en-US.ts │ │ │ └── zh-CN.ts │ │ └── models │ │ │ ├── blockInfo.ts │ │ │ ├── btcPriceInfo.ts │ │ │ ├── chainSyncInfo.ts │ │ │ ├── minerInfo.ts │ │ │ ├── miningInfo.ts │ │ │ ├── nodeList.ts │ │ │ └── operationBoard.ts │ ├── publicData │ │ ├── component │ │ │ ├── BlockInfoTable.tsx │ │ │ ├── ChainInfoTable.tsx │ │ │ └── TokenPriceInfoTable.tsx │ │ ├── index.tsx │ │ └── locales │ │ │ ├── en-US.ts │ │ │ └── zh-CN.ts │ ├── sysConf │ │ └── index.tsx │ ├── user │ │ └── login │ │ │ ├── components │ │ │ └── Login │ │ │ │ ├── LoginContext.tsx │ │ │ │ ├── LoginItem.tsx │ │ │ │ ├── LoginSubmit.tsx │ │ │ │ ├── LoginTab.tsx │ │ │ │ ├── index.less │ │ │ │ ├── index.tsx │ │ │ │ └── map.tsx │ │ │ ├── index.tsx │ │ │ ├── locales │ │ │ ├── en-US.ts │ │ │ └── zh-CN.ts │ │ │ └── style.less │ └── wallet │ │ ├── components │ │ ├── AddAccountForm.tsx │ │ └── walletTable.tsx │ │ ├── index.tsx │ │ ├── locales │ │ ├── en-US.ts │ │ └── zh-CN.ts │ │ └── models │ │ ├── addAccount.ts │ │ └── wallet.ts ├── service-worker.js ├── services │ ├── API.d.ts │ ├── client │ │ ├── Client.ts │ │ ├── data.d.ts │ │ ├── miningInfo.ts │ │ └── socket.ts │ ├── constants.ts │ ├── locale.ts │ ├── login.ts │ ├── publicdata │ │ ├── chainInfo.ts │ │ ├── data.d.ts │ │ ├── exportUtils.ts │ │ └── tokenInfo.ts │ ├── sysConf │ │ ├── conf.ts │ │ └── data.d.ts │ ├── user.ts │ └── wallet │ │ ├── account.ts │ │ ├── data.d.ts │ │ ├── faucet.ts │ │ └── key.ts ├── typings.d.ts └── utils │ ├── utils.less │ ├── utils.test.ts │ └── utils.ts ├── tests ├── PuppeteerEnvironment.js ├── beforeTest.js ├── getBrowser.js └── run-tests.js └── tsconfig.json /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Steps To Reproduce** 14 | Please provide detailed instructions (e.g. command line invocation with parameters) to reproduce the behavior. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Environment (please complete the following information):** 20 | - OS: [e.g. Ubuntu / Debian] 21 | - Rust version 22 | - Version of the appropriate binary / software package 23 | 24 | **Additional context** 25 | Please include any relevant stack traces, error messages and logs. 26 | 27 | If you are encountering an issue with a smart contract, please include the smart contract code 28 | that demonstrates the issue. 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'feature' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/testnet-bug.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Testnet Bug 3 | about: Use this template to submit Stacks 2.0 testnet bugs 4 | title: "[TESTNET BUG]" 5 | labels: bug, testnet 6 | assignees: 'timstackblock' 7 | 8 | --- 9 | 10 | ## Describe the bug 11 | 12 | A clear and concise description of what the bug is. 13 | 14 | ## Steps To Reproduce 15 | 16 | Please provide detailed instructions (e.g. command line invocation with parameters) to reproduce the behavior. 17 | 18 | ## Expected behavior 19 | 20 | A clear and concise description of what you expected to happen. 21 | 22 | ## Environment 23 | 24 | - OS: [e.g. Ubuntu / Debian] 25 | - Rust version 26 | - Output of `stacks-node version` 27 | 28 | ## Additional context 29 | 30 | Please include any relevant stack traces, error messages and logs. 31 | 32 | If you are encountering an issue with a smart contract, please include the smart contract code 33 | that demonstrates the issue. 34 | 35 | ---- 36 | 37 | If you think this is eligible for a [bug bounty](https://testnet.blockstack.org/bounties), please check the relevant boxes below: 38 | 39 | ### Critical, Launch Blocking Bugs 40 | **Consensus critical bugs** 41 | - [ ] Can cause a chain split 42 | - [ ] Can cause an invalid transaction to get mined 43 | - [ ] Can cause an invalid block to get accepted 44 | - [ ] Can cause a node to stall 45 | 46 | **State corruption** 47 | - [ ] Can modify a smart contract’s data maps and data vars without a `contract-call? 48 | 49 | **Stolen funds** 50 | - [ ] Any address losing STX without a corresponding transfer 51 | - [ ] Modify token balances and NFT ownership in other contracts without a `contract-call?` 52 | 53 | **Take control and/or bring network to a halt** 54 | - [ ] Take control and/or bring network to a halt 55 | 56 | ### Major, Launch Blocking Bugs 57 | **Major bugs** 58 | - [ ] Performance or correctness bugs that don’t rise to P0 level 59 | - [ ] Stress test or DoS attacks that slow things down enough 60 | - [ ] Resource exhaustion 61 | - [ ] Expected functionality doesn’t work in obvious ways (important to be super specific with this wording) 62 | 63 | 64 | ### Minor, Non-launch blocking bugs 65 | **Minor bugs** 66 | - [ ] Bugs in non-critical software (CLI, UI, etc) that doesn’t impact critical functionality 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | **/node_modules 5 | # roadhog-api-doc ignore 6 | /src/utils/request-temp.js 7 | _roadhog-api-doc 8 | 9 | # production 10 | /dist 11 | /.vscode 12 | 13 | # misc 14 | .DS_Store 15 | npm-debug.log* 16 | yarn-error.log 17 | 18 | /coverage 19 | .idea 20 | yarn.lock 21 | package-lock.json 22 | *bak 23 | .vscode 24 | 25 | # visual studio code 26 | .history 27 | *.log 28 | functions/* 29 | .temp/** 30 | 31 | # umi 32 | .umi 33 | .umi-production 34 | 35 | # screenshot 36 | screenshot 37 | .firebase 38 | .eslintcache 39 | 40 | build 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mining-Bot 2 | 3 | 4 | Please Visit [Mining-Bot Documentation](https://daemon-technologies.github.io/docs/) 5 | 6 | - [WSL Tutorial Video](https://www.youtube.com/watch?v=FXifFx0Akzc) 7 | - [MacOS](https://www.youtube.com/watch?v=TCtCTttsSeI) 8 | -------------------------------------------------------------------------------- /config/config.ts: -------------------------------------------------------------------------------- 1 | // https://umijs.org/config/ 2 | import { defineConfig } from 'umi'; 3 | import defaultSettings from './defaultSettings'; 4 | import proxy from './proxy'; 5 | 6 | const { REACT_APP_ENV } = process.env; 7 | 8 | 9 | export default defineConfig({ 10 | hash: true, 11 | antd: {}, 12 | dva: { 13 | hmr: true, 14 | }, 15 | layout: { 16 | name: 'Stack Mining Bot', 17 | locale: true, 18 | siderWidth: 208, 19 | logo: '../../header.png' 20 | }, 21 | locale: { 22 | // default: 'en-US', 23 | default: 'en-US', 24 | antd: true, 25 | // default true, when it is true, will use `navigator.language` overwrite default 26 | baseNavigator: false, 27 | }, 28 | dynamicImport: { 29 | loading: '@/components/PageLoading/index', 30 | }, 31 | targets: { 32 | ie: 11, 33 | }, 34 | // umi routes: https://umijs.org/docs/routing 35 | routes: [ 36 | { 37 | path: '/user', 38 | layout: false, 39 | routes: [ 40 | { 41 | name: 'login', 42 | path: '/user/login', 43 | component: './user/login', 44 | }, 45 | ], 46 | }, 47 | { 48 | path: '/publicData', 49 | name: 'publicData', 50 | icon: 'LineChartOutlined', 51 | component: './publicData', 52 | }, 53 | { 54 | path: '/wallet', 55 | name: 'wallet', 56 | icon: 'TeamOutlined', 57 | component: './wallet', 58 | }, 59 | { 60 | path: '/client', 61 | name: 'client', 62 | icon: 'FundProjectionScreenOutlined', 63 | component: './client', 64 | }, 65 | { 66 | path: '/sysConf', 67 | name: 'sysConf', 68 | icon: 'UnorderedListOutlined', 69 | component: './sysConf', 70 | }, 71 | { 72 | path: '/', 73 | redirect: `/publicData`, 74 | }, 75 | 76 | { 77 | component: './404', 78 | }, 79 | ], 80 | // Theme for antd: https://ant.design/docs/react/customize-theme-cn 81 | theme: { 82 | // ...darkTheme, 83 | 'primary-color': defaultSettings.primaryColor, 84 | }, 85 | // @ts-ignore 86 | title: false, 87 | ignoreMomentLocale: true, 88 | proxy: proxy[REACT_APP_ENV || 'dev'], 89 | manifest: { 90 | basePath: '/', 91 | }, 92 | }); 93 | -------------------------------------------------------------------------------- /config/defaultSettings.ts: -------------------------------------------------------------------------------- 1 | import { Settings as LayoutSettings } from '@ant-design/pro-layout'; 2 | 3 | export default { 4 | navTheme: 'dark', 5 | // 拂晓蓝 6 | primaryColor: '#1890ff', 7 | layout: 'mix', 8 | contentWidth: 'Fluid', 9 | fixedHeader: false, 10 | fixSiderbar: true, 11 | colorWeak: false, 12 | menu: { 13 | locale: true, 14 | }, 15 | title: 'Mining Bot', 16 | pwa: false, 17 | iconfontUrl: '', 18 | } as LayoutSettings & { 19 | pwa: boolean; 20 | }; 21 | -------------------------------------------------------------------------------- /config/proxy.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置 3 | * The agent cannot take effect in the production environment 4 | * so there is no configuration of the production environment 5 | * For details, please see 6 | * https://pro.ant.design/docs/deploy 7 | */ 8 | export default { 9 | dev: { 10 | '/api/': { 11 | target: 'https://preview.pro.ant.design', 12 | changeOrigin: true, 13 | pathRewrite: { '^': '' }, 14 | }, 15 | }, 16 | test: { 17 | '/api/': { 18 | target: 'https://preview.pro.ant.design', 19 | changeOrigin: true, 20 | pathRewrite: { '^': '' }, 21 | }, 22 | }, 23 | pre: { 24 | '/api/': { 25 | target: 'your pre url', 26 | changeOrigin: true, 27 | pathRewrite: { '^': '' }, 28 | }, 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testURL: 'http://localhost:8000', 3 | testEnvironment: './tests/PuppeteerEnvironment', 4 | verbose: false, 5 | globals: { 6 | ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false, 7 | localStorage: null, 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "baseUrl": ".", 6 | "paths": { 7 | "@/*": ["./src/*"] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /mock/notices.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | 3 | const getNotices = (req: Request, res: Response) => { 4 | res.json({ 5 | data: [ 6 | { 7 | id: '000000001', 8 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', 9 | title: '你收到了 14 份新周报', 10 | datetime: '2017-08-09', 11 | type: 'notification', 12 | }, 13 | { 14 | id: '000000002', 15 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', 16 | title: '你推荐的 曲妮妮 已通过第三轮面试', 17 | datetime: '2017-08-08', 18 | type: 'notification', 19 | }, 20 | { 21 | id: '000000003', 22 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', 23 | title: '这种模板可以区分多种通知类型', 24 | datetime: '2017-08-07', 25 | read: true, 26 | type: 'notification', 27 | }, 28 | { 29 | id: '000000004', 30 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', 31 | title: '左侧图标用于区分不同的类型', 32 | datetime: '2017-08-07', 33 | type: 'notification', 34 | }, 35 | { 36 | id: '000000005', 37 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', 38 | title: '内容不要超过两行字,超出时自动截断', 39 | datetime: '2017-08-07', 40 | type: 'notification', 41 | }, 42 | { 43 | id: '000000006', 44 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 45 | title: '曲丽丽 评论了你', 46 | description: '描述信息描述信息描述信息', 47 | datetime: '2017-08-07', 48 | type: 'message', 49 | clickClose: true, 50 | }, 51 | { 52 | id: '000000007', 53 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 54 | title: '朱偏右 回复了你', 55 | description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', 56 | datetime: '2017-08-07', 57 | type: 'message', 58 | clickClose: true, 59 | }, 60 | { 61 | id: '000000008', 62 | avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', 63 | title: '标题', 64 | description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像', 65 | datetime: '2017-08-07', 66 | type: 'message', 67 | clickClose: true, 68 | }, 69 | { 70 | id: '000000009', 71 | title: '任务名称', 72 | description: '任务需要在 2017-01-12 20:00 前启动', 73 | extra: '未开始', 74 | status: 'todo', 75 | type: 'event', 76 | }, 77 | { 78 | id: '000000010', 79 | title: '第三方紧急代码变更', 80 | description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', 81 | extra: '马上到期', 82 | status: 'urgent', 83 | type: 'event', 84 | }, 85 | { 86 | id: '000000011', 87 | title: '信息安全考试', 88 | description: '指派竹尔于 2017-01-09 前完成更新并发布', 89 | extra: '已耗时 8 天', 90 | status: 'doing', 91 | type: 'event', 92 | }, 93 | { 94 | id: '000000012', 95 | title: 'ABCD 版本发布', 96 | description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', 97 | extra: '进行中', 98 | status: 'processing', 99 | type: 'event', 100 | }, 101 | ], 102 | }); 103 | }; 104 | 105 | export default { 106 | 'GET /api/notices': getNotices, 107 | }; 108 | -------------------------------------------------------------------------------- /mock/route.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | '/api/auth_routes': { 3 | '/form/advanced-form': { authority: ['admin', 'user'] }, 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /mock/user.ts: -------------------------------------------------------------------------------- 1 | import { Request, Response } from 'express'; 2 | 3 | function getFakeCaptcha(req: Request, res: Response) { 4 | return res.json('captcha-xxx'); 5 | } 6 | 7 | const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env; 8 | 9 | /** 10 | * 当前用户的权限,如果为空代表没登录 11 | * current user access, if is '', user need login 12 | * 如果是 pro 的预览,默认是有权限的 13 | */ 14 | let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : ''; 15 | 16 | const getAccess = () => { 17 | return access; 18 | }; 19 | 20 | // 代码中会兼容本地 service mock 以及部署站点的静态数据 21 | export default { 22 | // 支持值为 Object 和 Array 23 | 'GET /api/currentUser': (req: Request, res: Response) => { 24 | if (!getAccess()) { 25 | res.status(401).send({ 26 | data: { 27 | isLogin: false, 28 | }, 29 | errorCode: '401', 30 | errorMessage: '请先登录!', 31 | success: true, 32 | }); 33 | return; 34 | } 35 | res.send({ 36 | name: 'Stacker', 37 | avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png', 38 | userid: '00000001', 39 | email: 'antdesign@alipay.com', 40 | signature: '海纳百川,有容乃大', 41 | title: '交互专家', 42 | group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED', 43 | tags: [ 44 | { 45 | key: '0', 46 | label: '很有想法的', 47 | }, 48 | { 49 | key: '1', 50 | label: '专注设计', 51 | }, 52 | { 53 | key: '2', 54 | label: '辣~', 55 | }, 56 | { 57 | key: '3', 58 | label: '大长腿', 59 | }, 60 | { 61 | key: '4', 62 | label: '川妹子', 63 | }, 64 | { 65 | key: '5', 66 | label: '海纳百川', 67 | }, 68 | ], 69 | notifyCount: 12, 70 | unreadCount: 11, 71 | country: 'China', 72 | access: getAccess(), 73 | geographic: { 74 | province: { 75 | label: '浙江省', 76 | key: '330000', 77 | }, 78 | city: { 79 | label: '杭州市', 80 | key: '330100', 81 | }, 82 | }, 83 | address: '西湖区工专路 77 号', 84 | phone: '0752-268888888', 85 | }); 86 | }, 87 | // GET POST 可省略 88 | 'GET /api/users': [ 89 | { 90 | key: '1', 91 | name: 'John Brown', 92 | age: 32, 93 | address: 'New York No. 1 Lake Park', 94 | }, 95 | { 96 | key: '2', 97 | name: 'Jim Green', 98 | age: 42, 99 | address: 'London No. 1 Lake Park', 100 | }, 101 | { 102 | key: '3', 103 | name: 'Joe Black', 104 | age: 32, 105 | address: 'Sidney No. 1 Lake Park', 106 | }, 107 | ], 108 | 'POST /api/login/account': (req: Request, res: Response) => { 109 | const { password, username, type } = req.body; 110 | if (password === 'admin' && username === 'admin') { 111 | res.send({ 112 | status: 'ok', 113 | type, 114 | currentAuthority: 'admin', 115 | }); 116 | access = 'admin'; 117 | return; 118 | } 119 | if (password === 'user' && username === 'user') { 120 | res.send({ 121 | status: 'ok', 122 | type, 123 | currentAuthority: 'user', 124 | }); 125 | access = 'user'; 126 | return; 127 | } 128 | if (type === 'mobile') { 129 | res.send({ 130 | status: 'ok', 131 | type, 132 | currentAuthority: 'admin', 133 | }); 134 | return; 135 | } 136 | 137 | res.send({ 138 | status: 'error', 139 | type, 140 | currentAuthority: 'guest', 141 | }); 142 | access = 'guest'; 143 | }, 144 | 'GET /api/login/outLogin': (req: Request, res: Response) => { 145 | access = ''; 146 | res.send({ data: {}, success: true }); 147 | }, 148 | 'POST /api/register': (req: Request, res: Response) => { 149 | res.send({ status: 'ok', currentAuthority: 'user', success: true }); 150 | }, 151 | 'GET /api/500': (req: Request, res: Response) => { 152 | res.status(500).send({ 153 | timestamp: 1513932555104, 154 | status: 500, 155 | error: 'error', 156 | message: 'error', 157 | path: '/base/category/list', 158 | }); 159 | }, 160 | 'GET /api/404': (req: Request, res: Response) => { 161 | res.status(404).send({ 162 | timestamp: 1513932643431, 163 | status: 404, 164 | error: 'Not Found', 165 | message: 'No message available', 166 | path: '/base/category/list/2121212', 167 | }); 168 | }, 169 | 'GET /api/403': (req: Request, res: Response) => { 170 | res.status(403).send({ 171 | timestamp: 1513932555104, 172 | status: 403, 173 | error: 'Unauthorized', 174 | message: 'Unauthorized', 175 | path: '/base/category/list', 176 | }); 177 | }, 178 | 'GET /api/401': (req: Request, res: Response) => { 179 | res.status(401).send({ 180 | timestamp: 1513932555104, 181 | status: 401, 182 | error: 'Unauthorized', 183 | message: 'Unauthorized', 184 | path: '/base/category/list', 185 | }); 186 | }, 187 | 188 | 'GET /api/login/captcha': getFakeCaptcha, 189 | }; 190 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ant-design-pro", 3 | "version": "5.0.0-alpha.0", 4 | "private": true, 5 | "description": "An out-of-box UI solution for enterprise applications", 6 | "scripts": { 7 | "analyze": "cross-env ANALYZE=1 umi build", 8 | "build": "umi build", 9 | "deploy": "npm run site && npm run gh-pages", 10 | "dev": "npm run start:dev", 11 | "gh-pages": "gh-pages -d dist", 12 | "i18n-remove": "pro i18n-remove --locale=zh-CN --write", 13 | "postinstall": "umi g tmp", 14 | "lint": "umi g tmp && npm run lint:js && npm run lint:style && npm run lint:prettier", 15 | "lint-staged": "lint-staged", 16 | "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ", 17 | "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style", 18 | "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src", 19 | "lint:prettier": "prettier --check \"**/*\" --end-of-line auto", 20 | "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less", 21 | "prettier": "prettier -c --write \"**/*\"", 22 | "start": "umi dev", 23 | "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none umi dev", 24 | "start:no-mock": "cross-env MOCK=none umi dev", 25 | "start:no-ui": "cross-env UMI_UI=none umi dev", 26 | "start:pre": "cross-env REACT_APP_ENV=pre umi dev", 27 | "start:test": "cross-env REACT_APP_ENV=test MOCK=none umi dev", 28 | "pretest": "node ./tests/beforeTest", 29 | "test": "umi test", 30 | "test:all": "node ./tests/run-tests.js", 31 | "test:component": "umi test ./src/components", 32 | "tsc": "tsc" 33 | }, 34 | "lint-staged": { 35 | "**/*.less": "stylelint --syntax less", 36 | "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js", 37 | "**/*.{js,jsx,tsx,ts,less,md,json}": [ 38 | "prettier --write" 39 | ] 40 | }, 41 | "browserslist": [ 42 | "> 1%", 43 | "last 2 versions", 44 | "not ie <= 10" 45 | ], 46 | "dependencies": { 47 | "@ant-design/icons": "^4.0.0", 48 | "@ant-design/pro-layout": "^6.4.1", 49 | "@ant-design/pro-table": "^2.5.3", 50 | "@types/bip39": "^3.0.0", 51 | "antd": "^4.4.0", 52 | "bip32": "^2.0.5", 53 | "bip39": "^3.0.2", 54 | "bitcoinjs-lib": "^5.1.10", 55 | "blockstack": "^21.1.1", 56 | "c32check": "^1.1.2", 57 | "classnames": "^2.2.6", 58 | "crypto": "^1.0.1", 59 | "lodash": "^4.17.11", 60 | "mocha": "^8.1.3", 61 | "moment": "^2.25.3", 62 | "omit.js": "^2.0.2", 63 | "path-to-regexp": "2.4.0", 64 | "qs": "^6.9.0", 65 | "react": "^16.8.6", 66 | "react-dom": "^16.8.6", 67 | "react-helmet-async": "^1.0.4", 68 | "socket.io-client": "^3.0.4", 69 | "umi": "^3.2.14", 70 | "umi-request": "^1.0.8", 71 | "use-merge-value": "^1.0.1", 72 | "xlsx": "^0.16.9" 73 | }, 74 | "devDependencies": { 75 | "@ant-design/pro-cli": "^2.0.2", 76 | "@types/classnames": "^2.2.7", 77 | "@types/express": "^4.17.0", 78 | "@types/history": "^4.7.2", 79 | "@types/jest": "^26.0.0", 80 | "@types/lodash": "^4.14.144", 81 | "@types/qs": "^6.5.3", 82 | "@types/react": "^16.9.17", 83 | "@types/react-dom": "^16.8.4", 84 | "@types/react-helmet": "^5.0.13", 85 | "@umijs/fabric": "^2.2.0", 86 | "@umijs/plugin-blocks": "^2.0.5", 87 | "@umijs/plugin-esbuild": "^1.0.0-beta.2", 88 | "@umijs/preset-ant-design-pro": "^1.2.0", 89 | "@umijs/preset-react": "^1.4.8", 90 | "@umijs/preset-ui": "^2.0.9", 91 | "@umijs/yorkie": "^2.0.3", 92 | "carlo": "^0.9.46", 93 | "cross-env": "^7.0.0", 94 | "cross-port-killer": "^1.1.1", 95 | "detect-installer": "^1.0.1", 96 | "enzyme": "^3.11.0", 97 | "eslint": "^7.1.0", 98 | "express": "^4.17.1", 99 | "gh-pages": "^3.0.0", 100 | "husky": "^4.0.7", 101 | "jsdom-global": "^3.0.2", 102 | "lint-staged": "^10.0.0", 103 | "mockjs": "^1.0.1-beta3", 104 | "prettier": "^2.0.1", 105 | "pro-download": "1.0.1", 106 | "puppeteer-core": "^5.0.0", 107 | "stylelint": "^13.0.0" 108 | }, 109 | "engines": { 110 | "node": ">=10.0.0" 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /public/CNAME: -------------------------------------------------------------------------------- 1 | preview.pro.ant.design -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/favicon.ico -------------------------------------------------------------------------------- /public/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/header.png -------------------------------------------------------------------------------- /public/home_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/home_bg.png -------------------------------------------------------------------------------- /public/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/icons/icon-128x128.png -------------------------------------------------------------------------------- /public/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/icons/icon-192x192.png -------------------------------------------------------------------------------- /public/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/icons/icon-512x512.png -------------------------------------------------------------------------------- /public/pro_icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/stacks_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daemon-Technologies/Mining-Bot/d32dee37c7068072c79f018689c20d3bd5af1253/public/stacks_icon.png -------------------------------------------------------------------------------- /src/access.ts: -------------------------------------------------------------------------------- 1 | // src/access.ts 2 | import { getNetworkFromStorage } from '@/utils/utils' 3 | 4 | export default function access(initialState?: { currentUser?: API.UserInfo | undefined }) { 5 | let networkType = getNetworkFromStorage() 6 | return { 7 | 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /src/app.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { BasicLayoutProps, Settings as LayoutSettings } from '@ant-design/pro-layout'; 3 | import { notification } from 'antd'; 4 | import { history, RequestConfig, useModel } from 'umi'; 5 | import RightContent from '@/components/RightContent'; 6 | import Footer from '@/components/Footer'; 7 | import { ResponseError } from 'umi-request'; 8 | import defaultSettings from '../config/defaultSettings'; 9 | import { queryUserInfo } from './services/user'; 10 | import {getNetworkFromStorage} from '@/utils/utils' 11 | 12 | export async function getInitialState(): Promise<{ 13 | currentUser?: API.UserInfo; 14 | settings?: LayoutSettings; 15 | }> { 16 | // if it is *login page*, do not execute 17 | if (history.location.pathname !== '/user/login') { 18 | try { 19 | let password = await queryUserInfo(); 20 | return { 21 | currentUser: { password: password }, 22 | settings: defaultSettings, 23 | }; 24 | } catch (error) { 25 | history.push('/user/login'); 26 | } 27 | } 28 | 29 | let networkType = getNetworkFromStorage() 30 | if (networkType === null){ 31 | localStorage.setItem('network', 'Xenon') 32 | } 33 | 34 | return { 35 | settings: defaultSettings, 36 | }; 37 | } 38 | 39 | export const layout = ({ 40 | initialState, 41 | }: { 42 | initialState: { settings?: LayoutSettings; currentUser?: API.UserInfo }; 43 | }): BasicLayoutProps => { 44 | return { 45 | rightContentRender: () => , 46 | disableContentMargin: false, 47 | footerRender: () =>