-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuki Kishimoto <[email protected]>
- Loading branch information
Showing
17 changed files
with
81 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
nostr-protocol==0.12.0 | ||
nostr-protocol==0.32.1 | ||
mnemonic==0.21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from nostr_protocol import Keys, Metadata, EventBuilder, PublicKey, verify_nip05, get_nip05_profile | ||
|
||
|
||
def nip05(): | ||
async def nip05(): | ||
# ANCHOR: set-metadata | ||
# Create metadata object with name and NIP05 | ||
metadata = Metadata() \ | ||
|
@@ -16,24 +16,17 @@ def nip05(): | |
nip_05 = "[email protected]" | ||
public_key = PublicKey.parse("npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet") | ||
proxy = None | ||
try: | ||
verify_nip05(public_key, nip_05, proxy) | ||
if await verify_nip05(public_key, nip_05, proxy): | ||
print(f" '{nip_05}' verified, for {public_key.to_bech32()}") | ||
except Exception as e: | ||
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}: {e}") | ||
else: | ||
print(f" Unable to verify NIP-05, for {public_key.to_bech32()}") | ||
# ANCHOR_END: verify-nip05 | ||
|
||
# TODO: replace above code with the following one (due to changes to NIP-05 verify func) | ||
# if verify_nip05(public_key, nip_05, proxy): | ||
# print(f" '{nip_05}' verified, for {public_key.to_bech32()}") | ||
# else: | ||
# print(f" Unable to verify NIP-05, for {public_key.to_bech32()}") | ||
|
||
print() | ||
|
||
# ANCHOR: nip05-profile | ||
print("Profile NIP-05:") | ||
nip_05 = "[email protected]" | ||
profile = get_nip05_profile(nip_05) | ||
nip_05 = "[email protected]" | ||
profile = await get_nip05_profile(nip_05) | ||
print(f" {nip_05} Profile: {profile.to_bech32()}") | ||
# ANCHOR_END: nip05-profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ edition = "2021" | |
members = ["."] | ||
|
||
[dependencies] | ||
nostr = "0.31" | ||
nostr = "0.32" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.