From 9d2a87625bd1ac218054da8aa2d240e1e90252e4 Mon Sep 17 00:00:00 2001 From: hirokisan Date: Thu, 24 Oct 2024 18:23:47 +0900 Subject: [PATCH] chore: a few adjustment --- .../v5-account-get-wallet-balance.json | 56 +++++++++++++------ v5_account_service.go | 2 +- v5_account_service_test.go | 1 + 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json b/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json index 85af799..8ff654d 100644 --- a/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json +++ b/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json @@ -1,39 +1,61 @@ { "list": [ { - "totalEquity": "0.00009475", - "accountIMRate": "0", - "totalMarginBalance": "0.00009475", - "totalInitialMargin": "0", "accountType": "UNIFIED", - "totalAvailableBalance": "0.00009475", + "accountLTV": "0", + "accountIMRate": "0", "accountMMRate": "0", + "totalEquity": "79207.48963775", + "totalWalletBalance": "78429.79924861", + "totalMarginBalance": "78429.79924861", + "totalAvailableBalance": "78429.79924861", "totalPerpUPL": "0", - "totalWalletBalance": "0.00009475", - "accountLTV": "0", + "totalInitialMargin": "0", "totalMaintenanceMargin": "0", "coin": [ { - "availableToBorrow": "", - "bonus": "0", + "coin": "BTC", + "equity": "1.16350244", + "usdValue": "77769.03891392", + "walletBalance": "1.16350244", + "free": "", + "locked": "0", + "spotHedgingQty": "0", + "borrowAmount": "0.000000000000000000", + "availableToWithdraw": "1.16350244", "accruedInterest": "0", - "availableToWithdraw": "0.0000948", "totalOrderIM": "0", - "equity": "0.0000948", + "totalPositionIM": "0", "totalPositionMM": "0", - "usdValue": "0.00009475", "unrealisedPnl": "0", + "cumRealisedPnl": "0", + "bonus": "0", + "marginCollateral": true, "collateralSwitch": true, + "availableToBorrow": "" + }, + { + "coin": "USDT", + "equity": "1439.61537267", + "usdValue": "1438.45072383", + "walletBalance": "1439.61537267", + "free": "", + "locked": "100", "spotHedgingQty": "0", "borrowAmount": "0.000000000000000000", + "availableToWithdraw": "1339.61537267", + "accruedInterest": "0", + "totalOrderIM": "0", "totalPositionIM": "0", - "walletBalance": "0.0000948", - "cumRealisedPnl": "-43291.2691172", - "locked": "0", + "totalPositionMM": "0", + "unrealisedPnl": "0", + "cumRealisedPnl": "-1217.67369263", + "bonus": "0", "marginCollateral": true, - "coin": "USDT" + "collateralSwitch": true, + "availableToBorrow": "" } ] } ] - } \ No newline at end of file +} \ No newline at end of file diff --git a/v5_account_service.go b/v5_account_service.go index 358b630..3e5422f 100644 --- a/v5_account_service.go +++ b/v5_account_service.go @@ -42,7 +42,7 @@ type V5WalletBalanceCoin struct { Equity string `json:"equity"` UsdValue string `json:"usdValue"` WalletBalance string `json:"walletBalance"` - Free string `json:"free,omitempty"` + Free string `json:"free"` Locked string `json:"locked"` SpotHedgingQuantity string `json:"spotHedgingQty"` BorrowAmount string `json:"borrowAmount"` diff --git a/v5_account_service_test.go b/v5_account_service_test.go index 906e1d9..fbd0c2a 100644 --- a/v5_account_service_test.go +++ b/v5_account_service_test.go @@ -46,6 +46,7 @@ func TestV5Account_GetWalletBalance(t *testing.T) { "borrowAmount": "0", "totalPositionIM": "0", "walletBalance": "0.805994", + "free": "", "locked": "", "cumRealisedPnl": "0", "marginCollateral": true,