temp replace storage

This commit is contained in:
2024-10-29 15:57:27 +02:00
parent 93fb833df5
commit c9306493f0
20 changed files with 1901 additions and 1641 deletions

View File

@@ -330,6 +330,7 @@ export const decodeBase64ForUIChatMessages = (messages)=> {
export function decryptGroupData(data64EncryptedData: string, privateKey: string) {
console.log({data64EncryptedData, privateKey})
const allCombined = base64ToUint8Array(data64EncryptedData)
const str = "qortalGroupEncryptedData"
const strEncoder = new TextEncoder()

View File

@@ -5,6 +5,7 @@ import Base58 from "../../deps/Base58"
import nacl from "../../deps/nacl-fast"
import utils from "../../utils/utils"
import { createEndpoint, getBaseApi } from "../../background";
import { getData } from "../../utils/chromeStorage";
export async function reusableGet(endpoint){
const validApi = await getBaseApi();
@@ -34,9 +35,9 @@ export async function reusableGet(endpoint){
}
async function getKeyPair() {
const res = await chrome.storage.local.get(["keyPair"]);
if (res?.keyPair) {
return res.keyPair;
const res = await getData<any>("keyPair").catch(() => null);
if (res) {
return res
} else {
throw new Error("Wallet not authenticated");
}
@@ -118,7 +119,7 @@ export const publishData = async ({
const resKeyPair = await getKeyPair()
const parsedData = JSON.parse(resKeyPair)
const parsedData = resKeyPair
const uint8PrivateKey = Base58.decode(parsedData.privateKey);
const uint8PublicKey = Base58.decode(parsedData.publicKey);
const keyPair = {