diff --git a/integrationtest/v5/account/wallet_balance_test.go b/integrationtest/v5/account/account_test.go similarity index 93% rename from integrationtest/v5/account/wallet_balance_test.go rename to integrationtest/v5/account/account_test.go index 50dd7e6..0116146 100644 --- a/integrationtest/v5/account/wallet_balance_test.go +++ b/integrationtest/v5/account/account_test.go @@ -12,11 +12,10 @@ import ( func TestGetWalletBalance(t *testing.T) { client := bybit.NewTestClient().WithAuthFromEnv() - symbol := bybit.SymbolV5BTCUSDT res, err := client.V5().Account().GetWalletBalance(bybit.UnifiedAccount, "") require.NoError(t, err) { - goldenFilename := "./testdata/v5-account-get-wallet-balance.json" // TODO + goldenFilename := "./testdata/v5-account-get-wallet-balance.json" testhelper.Compare(t, goldenFilename, testhelper.ConvertToJSON(res.Result)) testhelper.UpdateFile(t, goldenFilename, testhelper.ConvertToJSON(res.Result)) } diff --git a/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json b/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json new file mode 100644 index 0000000..854a82c --- /dev/null +++ b/integrationtest/v5/account/testdata/v5-account-get-wallet-balance.json @@ -0,0 +1,48 @@ +{ + "list": [ + { + "totalEquity": "30587.3509045", + "accountIMRate": "0", + "totalMarginBalance": "30587.3509045", + "totalInitialMargin": "0", + "accountType": "UNIFIED", + "totalAvailableBalance": "30587.3509045", + "accountMMRate": "0", + "totalPerpUPL": "0", + "totalWalletBalance": "30587.3509045", + "totalMaintenanceMargin": "0", + "coin": [ + { + "availableToBorrow": "2.5", + "accruedInterest": "0", + "availableToWithdraw": "1.258926", + "totalOrderIM": "0", + "equity": "1.258926", + "totalPositionMM": "0", + "usdValue": "29579.89105993", + "unrealisedPnl": "0", + "borrowAmount": "0.0", + "totalPositionIM": "0", + "walletBalance": "1.258926", + "cumRealisedPnl": "0", + "coin": "BTC" + }, + { + "availableToBorrow": "2500000", + "accruedInterest": "0", + "availableToWithdraw": "912.35705796", + "totalOrderIM": "0", + "equity": "1012.35705796", + "totalPositionMM": "0", + "usdValue": "1007.45984457", + "unrealisedPnl": "0", + "borrowAmount": "0.0", + "totalPositionIM": "0", + "walletBalance": "1012.35705796", + "cumRealisedPnl": "0", + "coin": "USDT" + } + ] + } + ] +} \ No newline at end of file diff --git a/v5_account_service.go b/v5_account_service.go index 85f55ba..7effb07 100644 --- a/v5_account_service.go +++ b/v5_account_service.go @@ -25,7 +25,7 @@ type V5WalletBalanceResult struct { List []V5WalletBalanceList `json:"list"` } -// VV5WalletBalanceCoin : +// V5WalletBalanceCoin : type V5WalletBalanceCoin struct { AvailableToBorrow string `json:"availableToBorrow"` AccruedInterest string `json:"accruedInterest"`