Skip to content

Commit 925c5d5

Browse files
authored
Merge pull request #8 from beetapp/new_chains
Basic implementation of EOS based blockchains in the BeetEOS mutliwallet
2 parents ec94092 + 2776811 commit 925c5d5

30 files changed

+1862
-7704
lines changed

app/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>Beet Blockchain Companion</title>
5+
<title>BeetEOS Blockchain Companion</title>
66
</head>
77
<body class="text-center">
88
<div class="main" id="app">

package-lock.json

+1,511-2,051
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+31-33
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "beet",
3-
"productName": "Beet Blockchain Companion",
4-
"version": "0.17.0-rc1",
3+
"productName": "BeetEOS Blockchain Companion",
4+
"version": "0.0.1",
55
"apiversion": 3,
6-
"description": "Beet is a stand-alone key-manager and signing app for blockchains like BitShares, Bitcoin and others.",
7-
"author": "clockworkgr <[email protected]>",
6+
"description": "BeetEOS is a stand-alone key-manager and signing app for EOS based blockchains.",
7+
"author": "BeetEOS team",
88
"license": "MIT",
9-
"homepage": "https://github.com/bitshares/beet",
10-
"repository": "github:bitshares/beet",
9+
"homepage": "https://github.com/beetapp/beeteos",
10+
"repository": "github:beetapp/beeteos",
1111
"main": "app/background.js",
1212
"build": {
1313
"appId": "io.get-beet.beet",
14-
"productName": "Beet Blockchain Companion",
15-
"artifactName": "BeetSetup.${ext}",
14+
"productName": "BeetEOS Blockchain Companion",
15+
"artifactName": "BeetEOSSetup.${ext}",
1616
"files": [
1717
"app/**/*",
1818
"node_modules/**/*",
@@ -37,7 +37,6 @@
3737
}
3838
},
3939
"scripts": {
40-
"postinstall": "electron-builder install-app-deps",
4140
"start": "node build/start.js",
4241
"compile": "webpack --config=build/webpack.app.config.js --env=production",
4342
"build": "webpack --config=build/webpack.app.config.js --env=production && electron-builder --publish never",
@@ -52,54 +51,53 @@
5251
"@babel/runtime": "^7.19.0",
5352
"@noble/ed25519": "^1.6.1",
5453
"@noble/secp256k1": "^1.6.3",
55-
"balm-ui": "^10.9.3",
56-
"bitcoinjs-lib": "^6.0.1",
57-
"bitsharesjs": "https://github.com/bitshares/bitsharesjs#develop",
54+
"balm-ui": "^10.23.2",
5855
"crypto-js": "^4.1.1",
59-
"dexie": "^3.2.2",
56+
"dexie": "^3.2.4",
6057
"electron-devtools-installer": "^3.2.0",
61-
"linebyline": "^1.3.0",
58+
"eosjs": "^22.1.0",
59+
"eosjs-ecc": "^4.0.7",
6260
"lzma": "^2.3.2",
63-
"mitt": "^3.0.0",
61+
"mitt": "^3.0.1",
6462
"otpauth": "^8.0.1",
6563
"query-string": "^7.1.1",
6664
"simple-websocket": "^9.1.0",
67-
"socket.io": "^4.6.1",
65+
"socket.io": "^4.7.2",
6866
"typeface-rajdhani": "1.1.13",
6967
"typeface-roboto": "1.1.13",
7068
"uuid": "^8.3.2",
71-
"vue": "^3.2.37",
69+
"vue": "^3.3.5",
7270
"vue-i18n": "9",
7371
"vue-qrcode-reader": "^4.0.0",
74-
"vue-router": "^4.1.2",
75-
"vuex": "^4.0.2"
72+
"vue-router": "^4.2.5",
73+
"vuex": "^4.1.0"
7674
},
7775
"devDependencies": {
78-
"@babel/core": "^7.18.9",
79-
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
80-
"@babel/plugin-transform-runtime": "^7.18.9",
81-
"@babel/preset-env": "^7.18.9",
76+
"@babel/core": "^7.23.2",
77+
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
78+
"@babel/plugin-transform-runtime": "^7.23.2",
79+
"@babel/preset-env": "^7.23.2",
8280
"@soda/friendly-errors-webpack-plugin": "^1.8.1",
8381
"babel-loader": "^8.2.5",
84-
"css-loader": "^6.7.1",
82+
"css-loader": "^6.8.1",
8583
"electron": "^24.2.0",
8684
"electron-builder": "^23.1.0",
87-
"eslint": "^8.20.0",
88-
"eslint-plugin-vue": "^9.2.0",
85+
"eslint": "^8.51.0",
86+
"eslint-plugin-vue": "^9.17.0",
8987
"file-loader": "^6.2.0",
90-
"sass": "^1.53.0",
91-
"sass-loader": "^13.0.2",
88+
"sass": "^1.69.4",
89+
"sass-loader": "^13.3.2",
9290
"source-map-support": "^0.5.21",
93-
"style-loader": "^3.3.1",
91+
"style-loader": "^3.3.3",
9492
"vue-loader": "^17.0.0",
95-
"vue-template-compiler": "^2.7.7",
96-
"webpack": "^5.73.0",
93+
"vue-template-compiler": "^2.7.14",
94+
"webpack": "^5.89.0",
9795
"webpack-cli": "^4.10.0",
98-
"webpack-merge": "^5.8.0",
96+
"webpack-merge": "^5.10.0",
9997
"webpack-node-externals": "^3.0.0"
10098
},
10199
"optionalDependencies": {
102-
"bufferutil": "^4.0.6",
100+
"bufferutil": "^4.0.8",
103101
"utf-8-validate": "^5.0.9"
104102
}
105103
}

src/components/account-details.vue

-8
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@
8484
{{ account.accountName }}
8585
</ui-item-last-content>
8686
</ui-item>
87-
<ui-item :key="account.accountID">
88-
<ui-item-text-content v-if="account.accountName != account.accountID">
89-
{{ t('common.account_details_id_lbl') }}
90-
</ui-item-text-content>
91-
<ui-item-last-content>
92-
{{ account.accountID }}
93-
</ui-item-last-content>
94-
</ui-item>
9587
</ui-list>
9688
</ui-card>
9789
</div>

src/components/add-account.vue

+3-32
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
import { ipcRenderer } from 'electron';
44
import { useI18n } from 'vue-i18n';
55
6-
import ImportCloudPass from "./blockchains/bitshares/ImportCloudPass";
7-
import ImportBinFile from "./blockchains/bitshares/ImportBinFile";
8-
import ImportMemo from "./blockchains/bitshares/ImportMemo";
96
import ImportKeys from "./blockchains/ImportKeys";
10-
import ImportAddressBased from "./blockchains/address/ImportAddressBased";
117
128
import store from '../store/index';
139
import router from '../router/index.js';
@@ -294,7 +290,7 @@
294290
</span>
295291
</option>
296292
</select>
297-
<div v-if="selectedImportOptions.length > 1">
293+
<div v-if="selectedImportOptions.length > 0">
298294
<p class="my-3 font-weight-bold">
299295
{{ t('common.bts_importtype_cta') }}
300296
</p>
@@ -338,7 +334,7 @@
338334
</ui-button>
339335
</router-link>
340336

341-
<span v-if="selectedImportOptions.length > 1">
337+
<span v-if="selectedImportOptions.length > 0">
342338
<span v-if="selectedImport != 0">
343339
<ui-button
344340
raised
@@ -387,33 +383,8 @@
387383
v-else-if="step == 2"
388384
id="step2"
389385
>
390-
<ImportAddressBased
391-
v-if="selectedImportOption.type == 'address/ImportAddressBased'"
392-
v-model="importMethod"
393-
:chain="selectedChain"
394-
/>
395-
<ImportAddressBased
396-
v-else-if="selectedImportOption.type == 'ImportAddressBased'"
397-
v-model="importMethod"
398-
:chain="selectedChain"
399-
/>
400386
<ImportKeys
401-
v-else-if="selectedImportOption.type == 'ImportKeys'"
402-
v-model="importMethod"
403-
:chain="selectedChain"
404-
/>
405-
<ImportCloudPass
406-
v-else-if="selectedImportOption.type == 'bitshares/ImportCloudPass'"
407-
v-model="importMethod"
408-
:chain="selectedChain"
409-
/>
410-
<ImportBinFile
411-
v-else-if="selectedImportOption.type == 'bitshares/ImportBinFile'"
412-
v-model="importMethod"
413-
:chain="selectedChain"
414-
/>
415-
<ImportMemo
416-
v-else-if="selectedImportOption.type == 'bitshares/ImportMemo'"
387+
v-if="selectedImportOption.type == 'ImportKeys'"
417388
v-model="importMethod"
418389
:chain="selectedChain"
419390
/>

src/components/balances.vue

-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@
5959
let accountName = computed(() => {
6060
return props.account.accountName;
6161
});
62-
63-
/*
64-
let accountID = computed(() => {
65-
return props.account.accountID;
66-
});
67-
*/
6862
6963
let blockchain = computed(() => {
7064
return props.blockchain;

src/components/blockchains/ImportKeys.vue

+17-82
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
});
1717
1818
let accountname = ref("");
19-
let activepk = ref("");
20-
let ownerpk = ref("");
21-
let memopk = ref("");
22-
let includeOwner = ref(0);
19+
let privateKey = ref("");
2320
2421
let accessType = computed(() => {
2522
if (!props.chain) {
@@ -42,32 +39,31 @@
4239
}
4340
4441
async function next() {
45-
let blockchain = getBlockchainAPI(props.chain);
46-
let authorities = {};
42+
let blockchain = await getBlockchainAPI(props.chain);
4743
48-
if (requiredFields.value.active != null) {
49-
authorities.active = activepk.value;
50-
}
51-
if (requiredFields.value.memo != null) {
52-
authorities.memo = memopk.value;
53-
}
54-
if (includeOwner.value == 1 && requiredFields.value.owner != null) {
55-
authorities.owner = ownerpk.value;
44+
let authorities = {};
45+
if (requiredFields.value.privateKey != null) {
46+
authorities.privateKey = privateKey.value;
5647
}
5748
5849
let account;
5950
try {
60-
account = await blockchain.verifyAccount(accountname.value, authorities);
51+
account = await blockchain.verifyAccount(accountname.value, authorities.privateKey, props.chain);
6152
} catch (error) {
6253
console.log(error);
6354
ipcRenderer.send("notify", t("common.unverified_account_error"));
6455
return;
6556
}
6657
58+
if (!account) {
59+
console.log("Account not found");
60+
return;
61+
}
62+
6763
emitter.emit('accounts_to_import', [{
6864
account: {
6965
accountName: accountname.value,
70-
accountID: account.id,
66+
storedAccount: account,
7167
chain: props.chain,
7268
keys: authorities
7369
}
@@ -91,53 +87,20 @@
9187
<p class="my-3 font-weight-normal">
9288
{{ t('common.keys_cta') }}
9389
</p>
94-
<template v-if="requiredFields.active !== null">
90+
91+
<template v-if="requiredFields.privateKey !== null">
9592
<p class="mb-2 font-weight-bold">
9693
{{ t(accessType == 'account' ? 'common.active_authority' : 'common.public_authority') }}
9794
</p>
9895
<input
9996
id="inputActive"
100-
v-model="activepk"
97+
v-model="privateKey"
10198
type="password"
10299
class="form-control mb-3 small"
103100
:placeholder="t(accessType == 'account' ? 'common.active_authority_placeholder' : 'common.public_authority_placeholder')"
104101
required
105102
>
106103
</template>
107-
<template v-if="requiredFields.memo !== null">
108-
<p class="mb-2 font-weight-bold">
109-
{{ t('common.memo_authority') }}
110-
</p>
111-
<input
112-
id="inputMemo"
113-
v-model="memopk"
114-
type="password"
115-
class="form-control mb-3 small"
116-
:placeholder="t('common.memo_authority_placeholder')"
117-
required
118-
>
119-
</template>
120-
<template v-if="requiredFields.owner !== null">
121-
<ui-form-field>
122-
<ui-checkbox
123-
v-model="includeOwner"
124-
value="1"
125-
unchecked-value="0"
126-
input-id="incOwnerCB"
127-
/>
128-
<label>{{ t('common.include_owner_check') }}</label>
129-
</ui-form-field>
130-
<div v-if="includeOwner == 1">
131-
<input
132-
id="inputOwner"
133-
v-model="ownerpk"
134-
type="password"
135-
class="form-control mb-3 small"
136-
:placeholder="t('common.owner_authority_placeholder')"
137-
required
138-
>
139-
</div>
140-
</template>
141104

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

152-
<span v-if="includeOwner == 1 && requiredFields.memo != null && requiredFields.active != null">
153-
<ui-button
154-
v-if="
155-
accountname !== ''
156-
&& ownerpk !== ''
157-
&& memopk !== ''
158-
&& activepk !== ''
159-
"
160-
raised
161-
class="step_btn"
162-
type="submit"
163-
@click="next"
164-
>
165-
{{ t('common.next_btn') }}
166-
</ui-button>
167-
<ui-button
168-
v-else
169-
disabled
170-
class="step_btn"
171-
type="submit"
172-
>
173-
{{ t('common.next_btn') }}
174-
</ui-button>
175-
</span>
176-
<span v-else-if="includeOwner == 0 && requiredFields.memo != null && requiredFields.active != null">
115+
<span v-if="requiredFields.privateKey != null">
177116
<ui-button
178-
v-if="
179-
accountname !== ''
180-
&& memopk !== ''
181-
&& activepk !== ''
182-
"
117+
v-if="accountname !== '' && privateKey !== ''"
183118
raised
184119
class="step_btn"
185120
type="submit"

0 commit comments

Comments
 (0)