File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11package hyperliquid
22
33import (
4+ "math"
45 "os"
56 "testing"
67 "time"
@@ -71,6 +72,14 @@ func TestExchangeAPI_MarketOpen(testing *testing.T) {
7172 testing .Errorf ("MakeOpen() error = %v" , err )
7273 }
7374 testing .Logf ("MakeOpen() = %v" , res )
75+ avgPrice := res .Response .Data .Statuses [0 ].Filled .AvgPx
76+ if avgPrice == 0 {
77+ testing .Errorf ("res.Response.Data.Statuses[0].Filled.AvgPx = %v" , avgPrice )
78+ }
79+ totalSize := res .Response .Data .Statuses [0 ].Filled .TotalSz
80+ if totalSize != math .Abs (size ) {
81+ testing .Errorf ("res.Response.Data.Statuses[0].Filled.TotalSz = %v" , totalSize )
82+ }
7483 accountState , err := exchangeAPI .infoAPI .GetUserState (exchangeAPI .AccountAddress ())
7584 if err != nil {
7685 testing .Errorf ("GetAccountState() error = %v" , err )
Original file line number Diff line number Diff line change @@ -147,9 +147,9 @@ type CloseRequest struct {
147147}
148148
149149type FilledStatus struct {
150- OrderId int `json:"oid"`
151- AvgPx string `json:"avgPx"`
152- TotalSz string `json:"totalSz"`
150+ OrderId int `json:"oid"`
151+ AvgPx float64 `json:"avgPx,string "`
152+ TotalSz float64 `json:"totalSz,string "`
153153}
154154
155155type Liquidation struct {
You can’t perform that action at this time.
0 commit comments