Skip to content

Commit

Permalink
Merge pull request #8 from beetapp/new_chains
Browse files Browse the repository at this point in the history
Basic implementation of EOS based blockchains in the BeetEOS mutliwallet
  • Loading branch information
grctest authored Oct 20, 2023
2 parents ec94092 + 2776811 commit 925c5d5
Show file tree
Hide file tree
Showing 30 changed files with 1,862 additions and 7,704 deletions.
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<title>Beet Blockchain Companion</title>
<title>BeetEOS Blockchain Companion</title>
</head>
<body class="text-center">
<div class="main" id="app">
Expand Down
3,562 changes: 1,511 additions & 2,051 deletions package-lock.json

Large diffs are not rendered by default.

64 changes: 31 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "beet",
"productName": "Beet Blockchain Companion",
"version": "0.17.0-rc1",
"productName": "BeetEOS Blockchain Companion",
"version": "0.0.1",
"apiversion": 3,
"description": "Beet is a stand-alone key-manager and signing app for blockchains like BitShares, Bitcoin and others.",
"author": "clockworkgr <[email protected]>",
"description": "BeetEOS is a stand-alone key-manager and signing app for EOS based blockchains.",
"author": "BeetEOS team",
"license": "MIT",
"homepage": "https://github.com/bitshares/beet",
"repository": "github:bitshares/beet",
"homepage": "https://github.com/beetapp/beeteos",
"repository": "github:beetapp/beeteos",
"main": "app/background.js",
"build": {
"appId": "io.get-beet.beet",
"productName": "Beet Blockchain Companion",
"artifactName": "BeetSetup.${ext}",
"productName": "BeetEOS Blockchain Companion",
"artifactName": "BeetEOSSetup.${ext}",
"files": [
"app/**/*",
"node_modules/**/*",
Expand All @@ -37,7 +37,6 @@
}
},
"scripts": {
"postinstall": "electron-builder install-app-deps",
"start": "node build/start.js",
"compile": "webpack --config=build/webpack.app.config.js --env=production",
"build": "webpack --config=build/webpack.app.config.js --env=production && electron-builder --publish never",
Expand All @@ -52,54 +51,53 @@
"@babel/runtime": "^7.19.0",
"@noble/ed25519": "^1.6.1",
"@noble/secp256k1": "^1.6.3",
"balm-ui": "^10.9.3",
"bitcoinjs-lib": "^6.0.1",
"bitsharesjs": "https://github.com/bitshares/bitsharesjs#develop",
"balm-ui": "^10.23.2",
"crypto-js": "^4.1.1",
"dexie": "^3.2.2",
"dexie": "^3.2.4",
"electron-devtools-installer": "^3.2.0",
"linebyline": "^1.3.0",
"eosjs": "^22.1.0",
"eosjs-ecc": "^4.0.7",
"lzma": "^2.3.2",
"mitt": "^3.0.0",
"mitt": "^3.0.1",
"otpauth": "^8.0.1",
"query-string": "^7.1.1",
"simple-websocket": "^9.1.0",
"socket.io": "^4.6.1",
"socket.io": "^4.7.2",
"typeface-rajdhani": "1.1.13",
"typeface-roboto": "1.1.13",
"uuid": "^8.3.2",
"vue": "^3.2.37",
"vue": "^3.3.5",
"vue-i18n": "9",
"vue-qrcode-reader": "^4.0.0",
"vue-router": "^4.1.2",
"vuex": "^4.0.2"
"vue-router": "^4.2.5",
"vuex": "^4.1.0"
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
"@babel/plugin-transform-runtime": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/core": "^7.23.2",
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
"@babel/plugin-transform-runtime": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@soda/friendly-errors-webpack-plugin": "^1.8.1",
"babel-loader": "^8.2.5",
"css-loader": "^6.7.1",
"css-loader": "^6.8.1",
"electron": "^24.2.0",
"electron-builder": "^23.1.0",
"eslint": "^8.20.0",
"eslint-plugin-vue": "^9.2.0",
"eslint": "^8.51.0",
"eslint-plugin-vue": "^9.17.0",
"file-loader": "^6.2.0",
"sass": "^1.53.0",
"sass-loader": "^13.0.2",
"sass": "^1.69.4",
"sass-loader": "^13.3.2",
"source-map-support": "^0.5.21",
"style-loader": "^3.3.1",
"style-loader": "^3.3.3",
"vue-loader": "^17.0.0",
"vue-template-compiler": "^2.7.7",
"webpack": "^5.73.0",
"vue-template-compiler": "^2.7.14",
"webpack": "^5.89.0",
"webpack-cli": "^4.10.0",
"webpack-merge": "^5.8.0",
"webpack-merge": "^5.10.0",
"webpack-node-externals": "^3.0.0"
},
"optionalDependencies": {
"bufferutil": "^4.0.6",
"bufferutil": "^4.0.8",
"utf-8-validate": "^5.0.9"
}
}
8 changes: 0 additions & 8 deletions src/components/account-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,6 @@
{{ account.accountName }}
</ui-item-last-content>
</ui-item>
<ui-item :key="account.accountID">
<ui-item-text-content v-if="account.accountName != account.accountID">
{{ t('common.account_details_id_lbl') }}
</ui-item-text-content>
<ui-item-last-content>
{{ account.accountID }}
</ui-item-last-content>
</ui-item>
</ui-list>
</ui-card>
</div>
Expand Down
35 changes: 3 additions & 32 deletions src/components/add-account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
import { ipcRenderer } from 'electron';
import { useI18n } from 'vue-i18n';
import ImportCloudPass from "./blockchains/bitshares/ImportCloudPass";
import ImportBinFile from "./blockchains/bitshares/ImportBinFile";
import ImportMemo from "./blockchains/bitshares/ImportMemo";
import ImportKeys from "./blockchains/ImportKeys";
import ImportAddressBased from "./blockchains/address/ImportAddressBased";
import store from '../store/index';
import router from '../router/index.js';
Expand Down Expand Up @@ -294,7 +290,7 @@
</span>
</option>
</select>
<div v-if="selectedImportOptions.length > 1">
<div v-if="selectedImportOptions.length > 0">
<p class="my-3 font-weight-bold">
{{ t('common.bts_importtype_cta') }}
</p>
Expand Down Expand Up @@ -338,7 +334,7 @@
</ui-button>
</router-link>

<span v-if="selectedImportOptions.length > 1">
<span v-if="selectedImportOptions.length > 0">
<span v-if="selectedImport != 0">
<ui-button
raised
Expand Down Expand Up @@ -387,33 +383,8 @@
v-else-if="step == 2"
id="step2"
>
<ImportAddressBased
v-if="selectedImportOption.type == 'address/ImportAddressBased'"
v-model="importMethod"
:chain="selectedChain"
/>
<ImportAddressBased
v-else-if="selectedImportOption.type == 'ImportAddressBased'"
v-model="importMethod"
:chain="selectedChain"
/>
<ImportKeys
v-else-if="selectedImportOption.type == 'ImportKeys'"
v-model="importMethod"
:chain="selectedChain"
/>
<ImportCloudPass
v-else-if="selectedImportOption.type == 'bitshares/ImportCloudPass'"
v-model="importMethod"
:chain="selectedChain"
/>
<ImportBinFile
v-else-if="selectedImportOption.type == 'bitshares/ImportBinFile'"
v-model="importMethod"
:chain="selectedChain"
/>
<ImportMemo
v-else-if="selectedImportOption.type == 'bitshares/ImportMemo'"
v-if="selectedImportOption.type == 'ImportKeys'"
v-model="importMethod"
:chain="selectedChain"
/>
Expand Down
6 changes: 0 additions & 6 deletions src/components/balances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@
let accountName = computed(() => {
return props.account.accountName;
});
/*
let accountID = computed(() => {
return props.account.accountID;
});
*/
let blockchain = computed(() => {
return props.blockchain;
Expand Down
99 changes: 17 additions & 82 deletions src/components/blockchains/ImportKeys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
});
let accountname = ref("");
let activepk = ref("");
let ownerpk = ref("");
let memopk = ref("");
let includeOwner = ref(0);
let privateKey = ref("");
let accessType = computed(() => {
if (!props.chain) {
Expand All @@ -42,32 +39,31 @@
}
async function next() {
let blockchain = getBlockchainAPI(props.chain);
let authorities = {};
let blockchain = await getBlockchainAPI(props.chain);
if (requiredFields.value.active != null) {
authorities.active = activepk.value;
}
if (requiredFields.value.memo != null) {
authorities.memo = memopk.value;
}
if (includeOwner.value == 1 && requiredFields.value.owner != null) {
authorities.owner = ownerpk.value;
let authorities = {};
if (requiredFields.value.privateKey != null) {
authorities.privateKey = privateKey.value;
}
let account;
try {
account = await blockchain.verifyAccount(accountname.value, authorities);
account = await blockchain.verifyAccount(accountname.value, authorities.privateKey, props.chain);
} catch (error) {
console.log(error);
ipcRenderer.send("notify", t("common.unverified_account_error"));
return;
}
if (!account) {
console.log("Account not found");
return;
}
emitter.emit('accounts_to_import', [{
account: {
accountName: accountname.value,
accountID: account.id,
storedAccount: account,
chain: props.chain,
keys: authorities
}
Expand All @@ -91,53 +87,20 @@
<p class="my-3 font-weight-normal">
{{ t('common.keys_cta') }}
</p>
<template v-if="requiredFields.active !== null">

<template v-if="requiredFields.privateKey !== null">
<p class="mb-2 font-weight-bold">
{{ t(accessType == 'account' ? 'common.active_authority' : 'common.public_authority') }}
</p>
<input
id="inputActive"
v-model="activepk"
v-model="privateKey"
type="password"
class="form-control mb-3 small"
:placeholder="t(accessType == 'account' ? 'common.active_authority_placeholder' : 'common.public_authority_placeholder')"
required
>
</template>
<template v-if="requiredFields.memo !== null">
<p class="mb-2 font-weight-bold">
{{ t('common.memo_authority') }}
</p>
<input
id="inputMemo"
v-model="memopk"
type="password"
class="form-control mb-3 small"
:placeholder="t('common.memo_authority_placeholder')"
required
>
</template>
<template v-if="requiredFields.owner !== null">
<ui-form-field>
<ui-checkbox
v-model="includeOwner"
value="1"
unchecked-value="0"
input-id="incOwnerCB"
/>
<label>{{ t('common.include_owner_check') }}</label>
</ui-form-field>
<div v-if="includeOwner == 1">
<input
id="inputOwner"
v-model="ownerpk"
type="password"
class="form-control mb-3 small"
:placeholder="t('common.owner_authority_placeholder')"
required
>
</div>
</template>

<ui-grid>
<ui-grid-cell columns="12">
Expand All @@ -149,37 +112,9 @@
{{ t('common.back_btn') }}
</ui-button>

<span v-if="includeOwner == 1 && requiredFields.memo != null && requiredFields.active != null">
<ui-button
v-if="
accountname !== ''
&& ownerpk !== ''
&& memopk !== ''
&& activepk !== ''
"
raised
class="step_btn"
type="submit"
@click="next"
>
{{ t('common.next_btn') }}
</ui-button>
<ui-button
v-else
disabled
class="step_btn"
type="submit"
>
{{ t('common.next_btn') }}
</ui-button>
</span>
<span v-else-if="includeOwner == 0 && requiredFields.memo != null && requiredFields.active != null">
<span v-if="requiredFields.privateKey != null">
<ui-button
v-if="
accountname !== ''
&& memopk !== ''
&& activepk !== ''
"
v-if="accountname !== '' && privateKey !== ''"
raised
class="step_btn"
type="submit"
Expand Down
Loading

0 comments on commit 925c5d5

Please sign in to comment.