diff --git a/integrationtest-ws/v5/testdata/private-v5-position.json b/integrationtest-ws/v5/testdata/private-v5-position.json index 9761a4b..6d9063b 100644 --- a/integrationtest-ws/v5/testdata/private-v5-position.json +++ b/integrationtest-ws/v5/testdata/private-v5-position.json @@ -6,7 +6,6 @@ { "autoAddMargin": 0, "positionIdx": 0, - "tpSlMode": "", "tradeMode": 0, "riskId": 1, "riskLimitValue": "2000000", @@ -34,4 +33,4 @@ "positionStatus": "Normal" } ] -} \ No newline at end of file +} diff --git a/v5_ws_private_wallet_test.go b/v5_ws_private_wallet_test.go index aaff1ae..c3ceef8 100644 --- a/v5_ws_private_wallet_test.go +++ b/v5_ws_private_wallet_test.go @@ -72,70 +72,6 @@ func TestV5WebsocketPrivate_Wallet(t *testing.T) { require.NoError(t, err) } - assert.NoError(t, svc.Run()) - assert.NoError(t, svc.Ping()) - assert.NoError(t, svc.Close()) - }) - t.Run("for Contract", func(t *testing.T) { - respBody := map[string]interface{}{ - "topic": "wallet", - "id": "75d86e42f18b23b9ad2c1f10eaffa8bb:18483ff242aca593:0:01", - "creationTime": 1677226839837, - "data": []map[string]interface{}{ - { - "accountIMRate": "0.016", - "accountMMRate": "0.003", - "totalEquity": "12837.78330098", - "totalWalletBalance": "12840.4045924", - "totalMarginBalance": "12837.78330188", - "totalAvailableBalance": "12632.05767702", - "totalPerpUPL": "-2.62129051", - "totalInitialMargin": "205.72562486", - "totalMaintenanceMargin": "39.42876721", - "accountType": "UNIFIED", - "coin": map[string]interface{}{ - "coin": "USDC", - "equity": "200.62572554", - "usdValue": "200.62572554", - "walletBalance": "201.34882644", - "availableToWithdraw": "0", - "availableToBorrow": "1500000", - "borrowAmount": "0", - "accruedInterest": "0", - "totalOrderIM": "0", - "totalPositionIM": "202.99874213", - "totalPositionMM": "39.14289747", - "unrealisedPnl": "74.2768991", - "cumRealisedPnl": "-209.1544627", - }, - }, - }, - } - bytesBody, err := json.Marshal(respBody) - require.NoError(t, err) - - server, teardown := testhelper.NewWebsocketServer( - testhelper.WithWebsocketHandlerOption(V5WebsocketPrivatePath, bytesBody), - ) - defer teardown() - - wsClient := NewTestWebsocketClient(). - WithBaseURL(server.URL). - WithAuth("test", "test") - - svc, err := wsClient.V5().Private() - require.NoError(t, err) - - require.NoError(t, svc.Subscribe()) - - { - _, err := svc.SubscribeWallet(func(response V5WebsocketPrivateWalletResponse) error { - testhelper.Compare(t, respBody["data"].([]map[string]interface{})[0]["coin"], response.Data[0].Coins[0]) - return nil - }) - require.NoError(t, err) - } - assert.NoError(t, svc.Run()) assert.NoError(t, svc.Ping()) assert.NoError(t, svc.Close())