Added the ability to share account data

This commit is contained in:
DwCay
2022-08-30 22:49:13 +03:00
parent 86a6bf013d
commit 200f4f58a7
3 changed files with 50 additions and 9 deletions

View File

@@ -2,7 +2,6 @@ import resolveConfig from 'tailwindcss/resolveConfig';
import {cryptography, transactions} from '@liskhq/lisk-client';
import {removeFeatureAssetSchema, setFeatureAssetSchema} from './Schemas';
import {statusMap} from "../shared/statusMap";
import {labelMap} from "../shared/labelMap";
export const tailwindConfig = () => {
// Tailwind config
@@ -49,6 +48,17 @@ export const encryptAccountData = (data = [], passPhrase = '', pubKey = '') => {
})
}
export const encryptSharedData = (data = [], passPhrase = '', pubKey = '') => {
return data.map((item)=> {
let value = cryptography.encryptMessageWithPassphrase(item.seed + ":" + item.value, passPhrase, pubKey);
return {
label: item.key,
value: value.encryptedMessage,
value_nonce: value.nonce,
}
})
}
export const hashAccountData = (data = [], oldData = [], hashMap = {}) => {
const accountMap = data.reduce((acc, item) => ({
...acc,