mirror of
https://github.com/aljazceru/python-nostr.git
synced 2025-12-19 15:24:19 +01:00
better method names
This commit is contained in:
@@ -45,7 +45,7 @@ class Event():
|
|||||||
pub_key = PublicKey(bytes.fromhex("02" + self.public_key), True) # add 02 for schnorr (bip340)
|
pub_key = PublicKey(bytes.fromhex("02" + self.public_key), True) # add 02 for schnorr (bip340)
|
||||||
return pub_key.schnorr_verify(bytes.fromhex(self.id), bytes.fromhex(self.signature), None, raw=True)
|
return pub_key.schnorr_verify(bytes.fromhex(self.id), bytes.fromhex(self.signature), None, raw=True)
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_json_object(self) -> dict:
|
||||||
return {
|
return {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
"pubkey": self.public_key,
|
"pubkey": self.public_key,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class Filter:
|
|||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def to_json(self) -> dict:
|
def to_json_object(self) -> dict:
|
||||||
res = {}
|
res = {}
|
||||||
if self.IDs != None:
|
if self.IDs != None:
|
||||||
res["ids"] = self.IDs
|
res["ids"] = self.IDs
|
||||||
@@ -74,9 +74,9 @@ class Filters(UserList):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def to_json(self) -> list:
|
def to_json_array(self) -> list:
|
||||||
res = []
|
res = []
|
||||||
for filter in self.data:
|
for filter in self.data:
|
||||||
res.append(filter.to_json())
|
res.append(filter.to_json_object())
|
||||||
return res
|
return res
|
||||||
|
|
||||||
Reference in New Issue
Block a user