Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EloWord authored and EloWord committed Feb 6, 2024
1 parent d9a02ec commit 8099347
Show file tree
Hide file tree
Showing 190 changed files with 26,701 additions and 0 deletions.
707 changes: 707 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# qubic.li - Wallet

A simple wallet for the QUBIC Network. Find more about QUBIC on https://doc.qubic.world/ or visit us on https://qubic.li.
To join the QUBIC Community on discord use this link http://discord.gg/2vDMR8m.

## Local dev
To dev it locally use this:

```bash
yarn install

# if you want to use local express proxy for api requests, run in one terminal:
yarn run start-api-proxy

# start the app
yarn run start
```

## License
As we use some parts from the 451 Package to our Wallet also apply the Anti-Military License. See https://github.com/computor-tools/qubic-js
Further our Wallet Code is protected by the AGPL-3.0 License. You may use our Source-Code for what you need to do business.

## Installation
User either our Online Version on https://wallet.qubic.li or one of the Packages provided on our Website.

## Limited Support
We cannot support you in any case. You are welcome to provide updates, bugfixes or other code changes by pull requests.
118 changes: 118 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "yarn",
"analytics": false
},
"newProjectRoot": "projects",
"projects": {
"qubic-wallet": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/qubic-wallet",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "1.6kb",
"maximumError": "2mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all",
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "qubic-wallet:build:production"
},
"development": {
"browserTarget": "qubic-wallet:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "qubic-wallet:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
}
}
}
126 changes: 126 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
const {app, BrowserWindow} = require('electron')

if (require('electron-squirrel-startup')) return;

// this should be placed at top of main.js to handle setup events quickly
if (handleSquirrelEvent()) {
// squirrel event handled and app will exit in 1000ms, so don't do anything else
return;
}

function handleSquirrelEvent() {
if (process.argv.length === 1) {
return false;
}

const ChildProcess = require('child_process');
const path = require('path');

const appFolder = path.resolve(process.execPath, '..');
const rootAtomFolder = path.resolve(appFolder, '..');
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
const exeName = path.basename(process.execPath);

const spawn = function(command, args) {
let spawnedProcess, error;

try {
spawnedProcess = ChildProcess.spawn(command, args, {detached: true});
} catch (error) {}

return spawnedProcess;
};

const spawnUpdate = function(args) {
return spawn(updateDotExe, args);
};

const squirrelEvent = process.argv[1];
switch (squirrelEvent) {
case '--squirrel-install':
case '--squirrel-updated':
// Optionally do things such as:
// - Add your .exe to the PATH
// - Write to the registry for things like file associations and
// explorer context menus

// Install desktop and start menu shortcuts
spawnUpdate(['--createShortcut', exeName]);

setTimeout(app.quit, 1000);
return true;

case '--squirrel-uninstall':
// Undo anything you did in the --squirrel-install and
// --squirrel-updated handlers

// Remove desktop and start menu shortcuts
spawnUpdate(['--removeShortcut', exeName]);

setTimeout(app.quit, 1000);
return true;

case '--squirrel-obsolete':
// This is called on the outgoing version of your app before
// we update to the new version - it's the opposite of
// --squirrel-updated

app.quit();
return true;
}
};


const net = require("net")
const url = require("url");
const path = require("path");

let mainWindow

function createWindow () {
mainWindow = new BrowserWindow({
width: 1550,
height: 750,
//frame: false,
titleBarStyle: 'hidden',
webPreferences: {
nodeIntegration: true,
contextIsolation: false
},
icon: path.join(__dirname, 'reqs/qli.ico')
});

mainWindow.loadURL(
url.format({
pathname: path.join(__dirname, `/dist/qubic-wallet/index.html`),
protocol: "file:",
slashes: true
})
);

mainWindow.removeMenu();
mainWindow.setMenu(null);

mainWindow.webContents.setWindowOpenHandler((details) => {
require("electron").shell.openExternal(details.url);
return { action: 'deny' }
})

// Open the DevTools.
//mainWindow.webContents.openDevTools()

mainWindow.on('closed', function () {
mainWindow = null
})

}

app.on('ready', createWindow)

app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
})

app.on('activate', function () {
if (mainWindow === null) createWindow()
})
41 changes: 41 additions & 0 deletions dev-proxy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
var express = require('express'),
request = require('request'),
bodyParser = require('body-parser'),
app = express();

var myLimit = typeof(process.argv[2]) != 'undefined' ? process.argv[2] : '500kb';
console.log('Using limit: ', myLimit);

app.use(bodyParser.json({limit: myLimit}));

app.all('*', function (req, res, next) {

// allow CORS
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET, PUT, PATCH, POST, DELETE");
res.header("Access-Control-Allow-Headers", req.header('access-control-request-headers'));

if (req.method === 'OPTIONS') {
// CORS Preflight
res.send();
} else {
var targetURL = "https://api.qubic.li"; // target API to send request to
if (!targetURL) {
res.send(500, { error: 'There is no Target-Endpoint header in the request' });
return;
}
console.log("API CALL: " + req.method + "\t" + targetURL + req.url);
request({ url: targetURL + req.url, method: req.method, json: req.body, headers: {'Authorization': req.header('Authorization')} },
function (error, response, body) {
if (error) {
console.error('error: ' + response.statusCode)
}
}).pipe(res);
}
});

app.set('port', 7003);

app.listen(app.get('port'), function () {
console.log('Proxy server listening on port ' + app.get('port'));
});
29 changes: 29 additions & 0 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
packagerConfig: {
icon: 'reqs/qli'
},
pluginOptions: {
electronBuilder: {
nodeIntegration: true
}
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {},
},
{
name: '@electron-forge/maker-rpm',
config: {},
},
],
};
30 changes: 30 additions & 0 deletions ngsw-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
]
}
}
]
}
Loading

0 comments on commit 8099347

Please sign in to comment.