@@ -10,7 +10,7 @@ use bitcoin::{
10
10
self , Keypair , Message , PublicKey , SECP256K1 , Scalar , SecretKey , rand, schnorr:: Signature ,
11
11
} ,
12
12
} ;
13
- use nostr_sdk :: ToBech32 ;
13
+ use nostr :: ToBech32 ;
14
14
use thiserror:: Error ;
15
15
16
16
pub type Result < T > = std:: result:: Result < T , Error > ;
@@ -20,12 +20,6 @@ pub enum Error {
20
20
#[ error( "Private key error: {0}" ) ]
21
21
PrivateKey ( #[ from] secp256k1:: Error ) ,
22
22
23
- #[ error( "Nostr key error: {0}" ) ]
24
- NostrKey ( #[ from] nostr_sdk:: key:: Error ) ,
25
-
26
- #[ error( "Nostr bech32 key error: {0}" ) ]
27
- NostrNip19 ( #[ from] nostr_sdk:: nips:: nip19:: Error ) ,
28
-
29
23
#[ error( "Ecies encryption error: {0}" ) ]
30
24
Ecies ( String ) ,
31
25
@@ -111,8 +105,8 @@ impl BcrKeys {
111
105
}
112
106
113
107
/// Returns the key pair as a nostr key pair
114
- pub fn get_nostr_keys ( & self ) -> nostr_sdk :: Keys {
115
- nostr_sdk :: Keys :: new ( self . inner . secret_key ( ) . into ( ) )
108
+ pub fn get_nostr_keys ( & self ) -> nostr :: Keys {
109
+ nostr :: Keys :: new ( self . inner . secret_key ( ) . into ( ) )
116
110
}
117
111
118
112
/// Returns the nostr public key as an XOnlyPublicKey hex string
@@ -172,7 +166,7 @@ pub fn is_node_id_nostr_hex_npub(node_id: &str, npub: &str) -> bool {
172
166
Ok ( pub_key) => pub_key,
173
167
Err ( _) => return false ,
174
168
} ;
175
- match nostr_sdk :: PublicKey :: from_hex ( & x_only_pub_key) {
169
+ match nostr :: PublicKey :: from_hex ( & x_only_pub_key) {
176
170
Ok ( npub_from_node_id) => npub == npub_from_node_id. to_hex ( ) ,
177
171
Err ( _) => false ,
178
172
}
@@ -738,14 +732,14 @@ mod tests {
738
732
npub_as_hex. to_string( )
739
733
) ;
740
734
let npub =
741
- nostr_sdk :: PublicKey :: from_hex ( & get_nostr_npub_as_hex_from_node_id ( node_id) . unwrap ( ) )
735
+ nostr :: PublicKey :: from_hex ( & get_nostr_npub_as_hex_from_node_id ( node_id) . unwrap ( ) )
742
736
. unwrap ( ) ;
743
737
assert_eq ! ( npub. to_hex( ) , npub_as_hex) ;
744
738
assert_eq ! (
745
739
get_nostr_npub_as_hex_from_node_id( TEST_NODE_ID_SECP ) . unwrap( ) ,
746
740
TEST_NODE_ID_SECP_AS_NPUB_HEX . to_string( )
747
741
) ;
748
- let npub = nostr_sdk :: PublicKey :: from_hex (
742
+ let npub = nostr :: PublicKey :: from_hex (
749
743
& get_nostr_npub_as_hex_from_node_id ( TEST_NODE_ID_SECP ) . unwrap ( ) ,
750
744
)
751
745
. unwrap ( ) ;
0 commit comments