Skip to content

Commit 8540791

Browse files
committed
shared secrets
1 parent 0d1fe73 commit 8540791

7 files changed

Lines changed: 1266 additions & 1556 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#LOCAL_TESTING=http://localhost:8081/
1+
LOCAL_TESTING=http://localhost:8081/
22

33
SIMPLE_BY_DEFAULT=1
44

electron/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ global.wallet = {
276276
decrypt:wallet.decrypt,
277277
getSalt:storage.getSalt,
278278
setSalt:storage.setSalt,
279+
createSharedSecret:wallet.createSharedSecret,
279280

280281

281282

electron/services/sockets.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class LowLevelSocketService {
107107
const server = this.ports[port] ? https.createServer(_certs, requestHandler) : http.createServer(requestHandler);
108108
this.websockets.push(new WebSocket.Server({ server }));
109109
server.listen(port);
110-
111110
return true;
112111
}));
113112

electron/services/wallet.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,14 @@ const getKeypairByID = id => {
191191
return null;
192192
}
193193

194+
const createSharedSecret = async (blockchain, scatterPublicKey, otherPublicKey) => {
195+
if(typeof plugins[blockchain].createSharedSecret !== 'function') return null;
196+
197+
const keypair = getKeypair(scatterPublicKey, blockchain);
198+
const privateKey = await getPrivateKeyForSigning(keypair.id, blockchain);
199+
return plugins[blockchain].createSharedSecret(scatterPublicKey, otherPublicKey, privateKey);
200+
};
201+
194202
const lock = () => {
195203
seed = null;
196204
scatter = storage.getScatter();
@@ -312,6 +320,7 @@ const EXPORTS = {
312320
getRawData,
313321
sign,
314322
getPrivateKey,
323+
createSharedSecret,
315324
reloading,
316325
isUnlocked,
317326
unlock,

html/prompt.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
font-weight: 300;
2222
padding:10px;
2323
background: rgba(0,0,0,0.02);
24-
text-align:left;
24+
text-align:center;
2525
}
2626

2727
span {

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
"dependencies": {
1919
"@ledgerhq/hw-app-eth": "^4.68.4",
2020
"@ledgerhq/hw-transport-node-hid": "^4.78.0",
21-
"@walletpack/bitcoin": "^1.0.44",
22-
"@walletpack/core": "^1.0.41",
23-
"@walletpack/eosio": "^0.0.50",
24-
"@walletpack/ethereum": "^0.0.48",
25-
"@walletpack/tron": "^0.0.50",
26-
"@walletpack/fio": "^0.0.8",
21+
"@walletpack/bitcoin": "^1.0.51",
22+
"@walletpack/core": "^1.0.46",
23+
"@walletpack/eosio": "^0.0.58",
24+
"@walletpack/ethereum": "^0.0.56",
25+
"@walletpack/fio": "^0.0.23",
26+
"@walletpack/tron": "^0.0.59",
2727
"aes-oop": "^1.0.4",
2828
"asn1-ber": "^1.0.9",
2929
"bip32-path": "^0.4.2",

0 commit comments

Comments
 (0)