Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit c2e0dbd

Browse files
authored
Merge pull request #179 from 0xProject/fix/fillableTakerAssetAmountAsString
Fix `fillableTakerAssetAmount` in order event subscription payload
2 parents 74d4161 + 40ed769 commit c2e0dbd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

zeroex/order.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ type OrderEvent struct {
8181
TxHash common.Hash `json:"txHash"`
8282
}
8383

84+
// MarshalJSON implements a custom JSON marshaller for the SignedOrder type
85+
func (o *OrderEvent) MarshalJSON() ([]byte, error) {
86+
return json.Marshal(map[string]interface{}{
87+
"orderHash": o.OrderHash.Hex(),
88+
"signedOrder": o.SignedOrder,
89+
"kind": o.Kind,
90+
"fillableTakerAssetAmount": o.FillableTakerAssetAmount.String(),
91+
"txHash": o.TxHash.Hex(),
92+
})
93+
}
94+
8495
// OrderEventKind enumerates all the possible order event types
8596
type OrderEventKind string
8697

0 commit comments

Comments
 (0)