diff --git a/actions.go b/actions.go index 85fedba..a6943ef 100644 --- a/actions.go +++ b/actions.go @@ -108,10 +108,10 @@ type UpdateLeverageAction struct { // UpdateIsolatedMarginAction represents isolated margin update type UpdateIsolatedMarginAction struct { - Type string `json:"type" msgpack:"type"` - Asset int `json:"asset" msgpack:"asset"` - IsBuy bool `json:"isBuy" msgpack:"isBuy"` - Ntli float64 `json:"ntli" msgpack:"ntli"` + Type string `json:"type" msgpack:"type"` + Asset int `json:"asset" msgpack:"asset"` + IsBuy bool `json:"isBuy" msgpack:"isBuy"` + Ntli int64 `json:"ntli" msgpack:"ntli"` } // OrderWire represents the wire format for orders with deterministic field ordering diff --git a/actions_easyjson.go b/actions_easyjson.go index 4bad954..cc7fd45 100644 --- a/actions_easyjson.go +++ b/actions_easyjson.go @@ -804,7 +804,7 @@ func easyjsonB97b45a3DecodeGithubComSoniricoGoHyperliquid8(in *jlexer.Lexer, out if in.IsNull() { in.Skip() } else { - out.Ntli = float64(in.Float64()) + out.Ntli = int64(in.Int64()) } default: in.SkipRecursive() @@ -838,7 +838,7 @@ func easyjsonB97b45a3EncodeGithubComSoniricoGoHyperliquid8(out *jwriter.Writer, { const prefix string = ",\"ntli\":" out.RawString(prefix) - out.Float64(float64(in.Ntli)) + out.Int64(int64(in.Ntli)) } out.RawByte('}') } diff --git a/examples/leverage_test.go b/examples/leverage_test.go index 335e7c7..2031cca 100644 --- a/examples/leverage_test.go +++ b/examples/leverage_test.go @@ -23,7 +23,7 @@ func TestUpdateLeverage(t *testing.T) { func TestUpdateIsolatedMargin(t *testing.T) { exchange := newTestExchange(t) - amount := 1000.0 // Amount in USD + amount := 100.2 // Amount in USD name := "BTC" resp, err := exchange.UpdateIsolatedMargin(context.TODO(), amount, name) diff --git a/exchange_others.go b/exchange_others.go index b155167..b76af77 100644 --- a/exchange_others.go +++ b/exchange_others.go @@ -53,7 +53,7 @@ func (e *Exchange) UpdateIsolatedMargin( Type: "updateIsolatedMargin", Asset: asset, IsBuy: amount > 0, - Ntli: abs(amount), + Ntli: int64(amount * 1000000), } var result UserState