From 6fe3624ba0b5b52533015de72e1576c229a1841d Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Sun, 18 May 2025 05:45:01 +0300 Subject: [PATCH] add contact with QRCode --- Cargo.lock | 3 + helpers/app-auth/src/App.svelte | 2 +- helpers/net-auth/src/App.svelte | 2 +- nextgraph/src/local_broker.rs | 3 +- ng-app/index-web.html | 5 +- ng-app/src/App.svelte | 2 +- ng-app/src/apps/ContactEditor.svelte | 116 ++++++++++ ng-app/src/apps/ProfileEditor.svelte | 88 ++++++++ ng-app/src/apps/ProfileQrCode.svelte | 84 ++++++++ ng-app/src/apps/ProfileView.svelte | 88 ++++++++ ng-app/src/apps/SocialQueryDemo.svelte | 42 ++-- ng-app/src/classes.ts | 17 ++ ng-app/src/lib/Login.svelte | 2 +- ng-app/src/lib/icons/DataClassIcon.svelte | 2 + ng-app/src/lib/icons/ZeraIcon.svelte | 7 +- ng-app/src/locales/en.json | 5 +- ng-app/src/routes/WalletInfo.svelte | 2 +- ng-app/src/routes/WalletLoginQr.svelte | 4 +- ng-app/src/store.ts | 4 +- ng-app/src/tab.ts | 7 + ng-app/src/zeras.ts | 40 ++++ ng-net/Cargo.toml | 1 + ng-net/src/app_protocol.rs | 22 ++ ng-net/src/types.rs | 45 ++++ ng-oxigraph/src/oxigraph/storage/mod.rs | 5 +- ng-repo/src/errors.rs | 6 + ng-repo/src/store.rs | 8 +- ng-repo/src/types.rs | 7 + ng-sdk-js/src/lib.rs | 64 ++++++ ng-verifier/Cargo.toml | 2 + ng-verifier/src/commits/transaction.rs | 1 - ng-verifier/src/inbox_processor.rs | 8 +- ng-verifier/src/request_processor.rs | 244 +++++++++++++++------- ng-verifier/src/verifier.rs | 82 +++++++- ng-wallet/src/types.rs | 33 --- 35 files changed, 907 insertions(+), 146 deletions(-) create mode 100644 ng-app/src/apps/ContactEditor.svelte create mode 100644 ng-app/src/apps/ProfileEditor.svelte create mode 100644 ng-app/src/apps/ProfileQrCode.svelte create mode 100644 ng-app/src/apps/ProfileView.svelte diff --git a/Cargo.lock b/Cargo.lock index 97135531..e0462329 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3376,6 +3376,7 @@ dependencies = [ "unique_id", "url", "web-time", + "zeroize", ] [[package]] @@ -3532,6 +3533,7 @@ dependencies = [ "async-std", "async-trait", "automerge", + "base64-url", "either", "futures", "getrandom 0.2.10", @@ -3540,6 +3542,7 @@ dependencies = [ "ng-oxigraph", "ng-repo", "ng-storage-rocksdb", + "qrcode", "rand 0.7.3", "sbbf-rs-safe", "serde", diff --git a/helpers/app-auth/src/App.svelte b/helpers/app-auth/src/App.svelte index 8d1f17e7..5417db8d 100644 --- a/helpers/app-auth/src/App.svelte +++ b/helpers/app-auth/src/App.svelte @@ -56,7 +56,7 @@ routes.set("/user", User); routes.set("/wallet", WalletInfo); routes.set("/user/accounts", AccountInfo); - routes.set("/wallet/scanqr", ScanQRWeb); + routes.set("/scanqr", ScanQRWeb); routes.set("*", NotFound); let unsubscribe = () => {}; diff --git a/helpers/net-auth/src/App.svelte b/helpers/net-auth/src/App.svelte index c6690423..8913b84e 100644 --- a/helpers/net-auth/src/App.svelte +++ b/helpers/net-auth/src/App.svelte @@ -48,7 +48,7 @@ // routes.set("/user/registered", UserRegistered); // routes.set("/wallet", WalletInfo); // routes.set("/user/accounts", AccountInfo); - // routes.set("/wallet/scanqr", ScanQRWeb); + // routes.set("/scanqr", ScanQRWeb); // routes.set("/install", Install); routes.set("*", NotFound); diff --git a/nextgraph/src/local_broker.rs b/nextgraph/src/local_broker.rs index 74f13e9b..d0c38d03 100644 --- a/nextgraph/src/local_broker.rs +++ b/nextgraph/src/local_broker.rs @@ -1683,8 +1683,9 @@ pub fn wallet_to_wallet_recovery( Wallet::V0(v0) => { let mut content = v0.content.clone(); content.security_img = vec![]; + content.security_txt = String::new(); NgQRCodeWalletRecoveryV0 { - wallet: content, + wallet: serde_bare::to_vec(&content).unwrap(), pazzle, mnemonic, pin, diff --git a/ng-app/index-web.html b/ng-app/index-web.html index 8b01168c..aebb8f90 100644 --- a/ng-app/index-web.html +++ b/ng-app/index-web.html @@ -101,8 +101,9 @@
   Loading ...
- Your browser is too old and does not support NextGraph.
Please upgrade to a newer version of this browser,
try with another browser,

or install our native apps on
- Linux, macOS, Windows desktops and laptops,
and iOS, Android mobiles.


If you are using jshelter or another javascript protection mechanism, please deactivate it as we need access to the WebWorker facility of your browser. + Your browser is too old or is miss-configured.
Please upgrade to a newer version of this browser,
try with another browser,

or install our native apps on
+ Linux, macOS, Windows desktops and laptops,
and iOS, Android mobiles.


If you are using jshelter or another javascript protection mechanism, + please deactivate it as we need access to the WebWorker, JIT and WASM features of your browser. If those features are disabled, please enable them for this website.