Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions zeroex/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ type OrderEvent struct {
TxHash common.Hash `json:"txHash"`
}

// MarshalJSON implements a custom JSON marshaller for the SignedOrder type
func (o *OrderEvent) MarshalJSON() ([]byte, error) {
return json.Marshal(map[string]interface{}{
"orderHash": o.OrderHash.Hex(),
"signedOrder": o.SignedOrder,
"kind": o.Kind,
"fillableTakerAssetAmount": o.FillableTakerAssetAmount.String(),
"txHash": o.TxHash.Hex(),
})
}

// OrderEventKind enumerates all the possible order event types
type OrderEventKind string

Expand Down