remove typescript pieces
parent
93a5d91f0a
commit
eaa4ec395a
File diff suppressed because it is too large
Load Diff
@ -1,25 +0,0 @@
|
||||
{
|
||||
"name": "backend",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "src/server.ts",
|
||||
"scripts": {
|
||||
"dev": "nodemon src/server.ts",
|
||||
"build": "rm -rf build/ && prettier --write src/ && tsc"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@types/axios": "^0.14.0",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/morgan": "^1.9.4",
|
||||
"axios": "^1.4.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"express": "^4.18.2",
|
||||
"morgan": "^1.10.0",
|
||||
"nodemon": "^2.0.22",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.4"
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
require('dotenv').config()
|
||||
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import axios, { Axios, AxiosResponse } from 'axios';
|
||||
|
||||
const LWS_URL = process.env.LWS_URL ?? "http://127.0.0.1:8080";
|
||||
const LWS_ADMIN_URL = process.env.LWS_ADMIN_URL ?? "http://127.0.0.1:8081";
|
||||
|
||||
// interface Auth {
|
||||
// auth: String;
|
||||
// }
|
||||
|
||||
// accept_requests: {"type": "import"|"create", "addresses":[...]}
|
||||
// add_account: {"address": ..., "key": ...}
|
||||
// list_accounts: {}
|
||||
// list_requests: {}
|
||||
// modify_account_status: {"status": "active"|"hidden"|"inactive", "addresses":[...]}
|
||||
// reject_requests: {"type": "import"|"create", "addresses":[...]}
|
||||
// rescan: {"height":..., "addresses":[...]}
|
||||
// webhook_add: {"type":"tx-confirmation", "address":"...", "url":"...", ...} with optional fields:
|
||||
// token: A string to be returned when the webhook is triggered
|
||||
// payment_id: 16 hex characters representing a unique identifier for a transaction
|
||||
// webhook_delete
|
||||
|
||||
const listAccounts = async (req: Request, res: Response, next: NextFunction) => {
|
||||
let response: AxiosResponse = await axios.post(`${LWS_ADMIN_URL}/list_accounts`, {
|
||||
"auth": ""
|
||||
});
|
||||
return res.status(200).json({
|
||||
message: response.data
|
||||
});
|
||||
};
|
||||
|
||||
const getAddressInfo = async (req: Request, res: Response, next: NextFunction) => {
|
||||
let response: AxiosResponse = await axios.post(`${LWS_URL}/get_address_info`, {
|
||||
"address": "",
|
||||
"view_key": ""
|
||||
});
|
||||
return res.status(200).json({
|
||||
message: response.data
|
||||
});
|
||||
}
|
||||
|
||||
export default { listAccounts, getAddressInfo };
|
@ -1,8 +0,0 @@
|
||||
import express from 'express';
|
||||
import controller from '../interfaces/main';
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/accounts', controller.listAccounts);
|
||||
router.get('/addressInfo', controller.getAddressInfo);
|
||||
|
||||
export = router;
|
@ -1,30 +0,0 @@
|
||||
import http from 'http';
|
||||
import express, { Express } from 'express';
|
||||
import morgan from 'morgan';
|
||||
import routes from './routes/main';
|
||||
|
||||
const router: Express = express();
|
||||
|
||||
router.use(morgan('dev'));
|
||||
router.use(express.urlencoded({ extended: false }));
|
||||
router.use(express.json());
|
||||
router.use((req, res, next) => {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Headers', 'origin, X-Requested-With, Content-Type, Accept, Authorization');
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.header('Access-Control-Allow-Methods', 'GET PATCH DELETE POST');
|
||||
return res.status(200).json({});
|
||||
}
|
||||
next();
|
||||
});
|
||||
router.use('/', routes);
|
||||
router.use((req, res, next) => {
|
||||
const error = new Error('not found');
|
||||
return res.status(404).json({
|
||||
message: error.message
|
||||
});
|
||||
});
|
||||
|
||||
const httpServer = http.createServer(router);
|
||||
const PORT: any = process.env.PORT ?? 8082;
|
||||
httpServer.listen(PORT, () => console.log(`The server is running on port ${PORT}`));
|
@ -1,12 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src",
|
||||
"target": "es6",
|
||||
"skipLibCheck": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/.svelte-kit
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
@ -1,2 +0,0 @@
|
||||
engine-strict=true
|
||||
resolution-mode=highest
|
@ -1,14 +0,0 @@
|
||||
# monero-lws frontend
|
||||
|
||||
Client side web application for managing wallets in `monero-lws`.
|
||||
|
||||
Everything is stored client side, encrypted.
|
||||
|
||||
/ - redirect to /setup if user not setup, to /login if not authenticated
|
||||
/setup - first time setup user account, encrypted session
|
||||
/login - log into encrypted session
|
||||
/wallet/add - add a wallet to LWS
|
||||
/wallet/:id - show wallet details (balances, txes, etc)
|
||||
/wallet/:id/remove - remove a wallet from LWS
|
||||
/wallet/:id/resync - resync wallet
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-auto": "^2.0.0",
|
||||
"@sveltejs/kit": "^1.5.0",
|
||||
"svelte": "^3.54.0",
|
||||
"vite": "^4.3.0"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
@ -1,2 +0,0 @@
|
||||
<h1>Welcome to SvelteKit</h1>
|
||||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
@ -1,2 +0,0 @@
|
||||
<h1>login</h1>
|
||||
<p>looks like you are not logged in</p>
|
@ -1,2 +0,0 @@
|
||||
<h1>setup</h1>
|
||||
<p>seems like no user account exists</p>
|
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
@ -1,13 +0,0 @@
|
||||
import adapter from '@sveltejs/adapter-auto';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
kit: {
|
||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||
adapter: adapter()
|
||||
}
|
||||
};
|
||||
|
||||
export default config;
|
@ -1,6 +0,0 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()]
|
||||
});
|
Loading…
Reference in New Issue