diff options
author | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-03-25 08:07:28 -0500 |
---|---|---|
committer | Michael Jurkoic <mjjurkoic@gmail.com> | 2024-03-25 08:07:28 -0500 |
commit | a66a287806ab5a8e9d5a3894287f578c5953de7e (patch) | |
tree | 640215e63dfe19d0f15a11588bb95c895afeee58 /include | |
parent | 111b9914c601730a3697a3b7ff8a60fd2c15a38a (diff) |
Replace Event::deserialize with static methods
Diffstat (limited to 'include')
-rw-r--r-- | include/nostr.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/nostr.hpp b/include/nostr.hpp index 2f37c51..1e462e7 100644 --- a/include/nostr.hpp +++ b/include/nostr.hpp @@ -47,8 +47,16 @@ struct Event /** * @brief Deserializes the event from a JSON string. * @param jsonString A stringified JSON object representing the event. + * @returns An event instance created from the JSON string. */ - void deserialize(std::string jsonString); + static Event fromString(std::string jsonString); + + /** + * @brief Deserializes the event from a JSON object. + * @param j A JSON object representing the event. + * @returns An event instance created from the JSON object. + */ + static Event fromJson(nlohmann::json j); private: /** |