From f2d3a578dd4407ede21d76724f71db70157cc83d Mon Sep 17 00:00:00 2001 From: Agusx1211 Date: Thu, 28 Sep 2023 13:42:31 +0000 Subject: [PATCH] Add marshal json --- intents/intent.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/intents/intent.go b/intents/intent.go index 1e9ba8e..26f60ee 100644 --- a/intents/intent.go +++ b/intents/intent.go @@ -42,6 +42,14 @@ func (i *Intent) UnmarshalJSON(data []byte) error { return nil } +func (i *Intent) MarshalJSON() ([]byte, error) { + return json.Marshal(JSONIntent{ + Version: i.Version, + Packet: i.Packet, + Signatures: i.signatures, + }) +} + func (intent *Intent) Hash() ([]byte, error) { packet := intent.Packet