mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-03-28 08:15:55 +00:00
have publickey as part of saved wallet
This commit is contained in:
parent
9a46bf5b63
commit
6cc43a6622
@ -104,6 +104,7 @@ async function getUserInfo() {
|
|||||||
const name = await getNameInfo();
|
const name = await getNameInfo();
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
|
publicKey: wallet.publicKey,
|
||||||
...addressInfo,
|
...addressInfo,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -250,9 +251,12 @@ async function decryptWallet({password, wallet, walletVersion}) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
const newWallet = {
|
||||||
|
...wallet,
|
||||||
|
publicKey: Base58.encode(keyPair.publicKey)
|
||||||
|
}
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
chrome.storage.local.set({ walletInfo: wallet }, () => {
|
chrome.storage.local.set({ walletInfo: newWallet }, () => {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
reject(new Error(chrome.runtime.lastError.message));
|
reject(new Error(chrome.runtime.lastError.message));
|
||||||
} else {
|
} else {
|
||||||
@ -366,6 +370,7 @@ async function listenForChatMessage({ nodeBaseUrl, senderAddress, senderPublicKe
|
|||||||
privateKey: uint8PrivateKey,
|
privateKey: uint8PrivateKey,
|
||||||
publicKey: uint8PublicKey
|
publicKey: uint8PublicKey
|
||||||
};
|
};
|
||||||
|
|
||||||
const decodedMessage = decryptChatMessage(encodedMessageObj.data, keyPair.privateKey, senderPublicKey, encodedMessageObj.reference)
|
const decodedMessage = decryptChatMessage(encodedMessageObj.data, keyPair.privateKey, senderPublicKey, encodedMessageObj.reference)
|
||||||
return { secretCode: decodedMessage };
|
return { secretCode: decodedMessage };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user