@@ -4,6 +4,7 @@ import type { Storage } from './types.js';
44export const storeIdentity = ( storage : Storage , identity : PrivateAppIdentity ) => {
55 storage . setItem ( 'hypergraph:app-identity-address' , identity . address ) ;
66 storage . setItem ( 'hypergraph:app-identity-address-private-key' , identity . addressPrivateKey ) ;
7+ storage . setItem ( 'hypergraph:app-identity-account-address' , identity . accountAddress ) ;
78 storage . setItem ( 'hypergraph:signature-public-key' , identity . signaturePublicKey ) ;
89 storage . setItem ( 'hypergraph:signature-private-key' , identity . signaturePrivateKey ) ;
910 storage . setItem ( 'hypergraph:encryption-public-key' , identity . encryptionPublicKey ) ;
@@ -15,6 +16,7 @@ export const storeIdentity = (storage: Storage, identity: PrivateAppIdentity) =>
1516export const loadIdentity = ( storage : Storage ) : PrivateAppIdentity | null => {
1617 const address = storage . getItem ( 'hypergraph:app-identity-address' ) ;
1718 const addressPrivateKey = storage . getItem ( 'hypergraph:app-identity-address-private-key' ) ;
19+ const accountAddress = storage . getItem ( 'hypergraph:app-identity-account-address' ) ;
1820 const signaturePublicKey = storage . getItem ( 'hypergraph:signature-public-key' ) ;
1921 const signaturePrivateKey = storage . getItem ( 'hypergraph:signature-private-key' ) ;
2022 const encryptionPublicKey = storage . getItem ( 'hypergraph:encryption-public-key' ) ;
@@ -24,6 +26,7 @@ export const loadIdentity = (storage: Storage): PrivateAppIdentity | null => {
2426 if (
2527 ! address ||
2628 ! addressPrivateKey ||
29+ ! accountAddress ||
2730 ! signaturePublicKey ||
2831 ! signaturePrivateKey ||
2932 ! encryptionPublicKey ||
@@ -36,6 +39,7 @@ export const loadIdentity = (storage: Storage): PrivateAppIdentity | null => {
3639 return {
3740 address,
3841 addressPrivateKey,
42+ accountAddress,
3943 signaturePublicKey,
4044 signaturePrivateKey,
4145 encryptionPublicKey,
@@ -48,6 +52,7 @@ export const loadIdentity = (storage: Storage): PrivateAppIdentity | null => {
4852export const wipeIdentity = ( storage : Storage ) => {
4953 storage . removeItem ( 'hypergraph:app-identity-address' ) ;
5054 storage . removeItem ( 'hypergraph:app-identity-address-private-key' ) ;
55+ storage . removeItem ( 'hypergraph:app-identity-account-address' ) ;
5156 storage . removeItem ( 'hypergraph:signature-public-key' ) ;
5257 storage . removeItem ( 'hypergraph:signature-private-key' ) ;
5358 storage . removeItem ( 'hypergraph:encryption-public-key' ) ;
0 commit comments