This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -318,6 +318,21 @@ impl<S: MutinyStorage> NostrManager<S> {
318318 Ok ( with_nip05)
319319 }
320320
321+ /// Sets the user's nostr profile metadata as deleted
322+ pub async fn delete_profile ( & self ) -> Result < Metadata , MutinyError > {
323+ let metadata = Metadata :: default ( )
324+ . name ( "Deleted" )
325+ . display_name ( "Deleted" )
326+ . about ( "Deleted" )
327+ . custom_field ( "deleted" , true ) ;
328+
329+ let event_id = self . client . set_metadata ( & metadata) . await ?;
330+ log_info ! ( self . logger, "New kind 0: {event_id}" ) ;
331+ self . storage . set_nostr_profile ( metadata. clone ( ) ) ?;
332+
333+ Ok ( metadata)
334+ }
335+
321336 pub fn get_profile ( & self ) -> Result < Metadata , MutinyError > {
322337 Ok ( self . storage . get_nostr_profile ( ) ?. unwrap_or_default ( ) )
323338 }
Original file line number Diff line number Diff line change @@ -1882,6 +1882,13 @@ impl MutinyWallet {
18821882 Ok ( JsValue :: from_serde ( & profile) ?)
18831883 }
18841884
1885+ /// Sets the user's nostr profile data to a "deleted" state
1886+ #[ wasm_bindgen]
1887+ pub async fn delete_profile ( & self ) -> Result < JsValue , MutinyJsError > {
1888+ let profile = self . inner . nostr . delete_profile ( ) . await ?;
1889+ Ok ( JsValue :: from_serde ( & profile) ?)
1890+ }
1891+
18851892 /// Syncs all of our nostr data from the configured primal instance
18861893 pub async fn sync_nostr ( & self ) -> Result < ( ) , MutinyJsError > {
18871894 self . inner . sync_nostr ( ) . await ?;
You can’t perform that action at this time.
0 commit comments