Skip to content

Commit

Permalink
feat: add funding period in trade result
Browse files Browse the repository at this point in the history
  • Loading branch information
fshiori committed Jan 15, 2020
1 parent 8eeb36d commit 11d21c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions v2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ type Trade struct {
Amount float64
Price float64
Side OrderSide
Period float64 // Period (Funding only)
}

func NewTradeFromRaw(pair string, raw []interface{}) (o *Trade, err error) {
Expand All @@ -610,6 +611,10 @@ func NewTradeFromRaw(pair string, raw []interface{}) (o *Trade, err error) {
Side: side,
}

if len(raw) == 5 {
o.Period = f64ValOrZero(raw[4])
}

return
}

Expand Down

0 comments on commit 11d21c1

Please sign in to comment.