diff --git a/exchanges/deribit/deribit.go b/exchanges/deribit/deribit.go index 18e4e0cd6e7..008d62e9891 100644 --- a/exchanges/deribit/deribit.go +++ b/exchanges/deribit/deribit.go @@ -119,7 +119,7 @@ const ( createAPIKey = "private/create_api_key" createSubAccount = "private/create_subaccount" disableAPIKey = "private/disable_api_key" - disableTFAForSubaccount = "private/disable_tfa_for_subaccount" // to be removed + disableTFAForSubaccount = "private/disable_tfa_for_subaccount" enableAffiliateProgram = "private/enable_affiliate_program" enableAPIKey = "private/enable_api_key" getAccessLog = "private/get_access_log" @@ -160,9 +160,6 @@ const ( invalidateBlockTradesSignature = "private/invalidate_block_trade_signature" movePositions = "private/move_positions" verifyBlockTrades = "private/verify_block_trade" - - falseStr = "false" - trueStr = "true" ) // Start implementing public and private exchange API funcs below @@ -434,11 +431,7 @@ func (d *Deribit) GetLastTradesByCurrency(ctx context.Context, currency, kind, s if count != 0 { params.Set("count", strconv.FormatInt(count, 10)) } - includeOldString := falseStr - if includeOld { - includeOldString = trueStr - } - params.Set("include_old", includeOldString) + params.Set("include_old", strconv.FormatBool(includeOld)) var resp PublicTradesData return &resp, d.SendHTTPRequest(ctx, exchange.RestFutures, common.EncodeURLValues(getLastTradesByCurrency, params), &resp) @@ -495,11 +488,7 @@ func (d *Deribit) GetLastTradesByInstrument(ctx context.Context, instrument, sta if count != 0 { params.Set("count", strconv.FormatInt(count, 10)) } - includeOldString := falseStr - if includeOld { - includeOldString = trueStr - } - params.Set("include_old", includeOldString) + params.Set("include_old", strconv.FormatBool(includeOld)) var resp PublicTradesData return &resp, d.SendHTTPRequest(ctx, exchange.RestFutures, common.EncodeURLValues(getLastTradesByInstrument, params), &resp) @@ -601,11 +590,7 @@ func (d *Deribit) GetRFQ(ctx context.Context, currency, kind string) ([]RFQ, err // GetTradeVolumes gets trade volumes' data of all instruments func (d *Deribit) GetTradeVolumes(ctx context.Context, extended bool) ([]TradeVolumesData, error) { params := url.Values{} - extendedStr := falseStr - if extended { - extendedStr = trueStr - } - params.Set("extended", extendedStr) + params.Set("extended", strconv.FormatBool(extended)) var resp []TradeVolumesData return resp, d.SendHTTPRequest(ctx, exchange.RestFutures, common.EncodeURLValues(getTradeVolumes, params), &resp) @@ -1021,11 +1006,7 @@ func (d *Deribit) CreateAPIKey(ctx context.Context, maxScope, name string, defau if name != "" { params.Set("name", name) } - defaultKeyStr := falseStr - if defaultKey { - defaultKeyStr = trueStr - } - params.Set("default", defaultKeyStr) + params.Set("default", strconv.FormatBool(defaultKey)) var resp APIKeyData return &resp, d.SendHTTPAuthRequest(ctx, exchange.RestFutures, http.MethodGet, createAPIKey, params, &resp) diff --git a/exchanges/deribit/deribit_test.go b/exchanges/deribit/deribit_test.go index d3ec9f1e49f..9e8edaa82d9 100644 --- a/exchanges/deribit/deribit_test.go +++ b/exchanges/deribit/deribit_test.go @@ -233,7 +233,7 @@ func TestGetMarkPriceHistory(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveMarkPriceHistory(btcPerpInstrument, time.Now().Add(-24*time.Hour), time.Now()); err != nil { + if _, err = d.WSRetriveMarkPriceHistory(btcPerpInstrument, time.Now().Add(-24*time.Hour), time.Now()); err != nil { t.Error(err) } } @@ -250,7 +250,7 @@ func TestGetBookSummaryByCurrency(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveBookBySummary(currencySOL, ""); err != nil { + if _, err = d.WSRetriveBookBySummary(currencySOL, ""); err != nil { t.Error(err) } } @@ -261,7 +261,7 @@ func TestGetBookSummaryByInstrument(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveBookSummaryByInstrument(btcPerpInstrument); err != nil { + if _, err = d.WSRetriveBookSummaryByInstrument(btcPerpInstrument); err != nil { t.Error(err) } } @@ -272,7 +272,7 @@ func TestGetContractSize(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveContractSize(btcPerpInstrument); err != nil { + if _, err = d.WSRetriveContractSize(btcPerpInstrument); err != nil { t.Error(err) } } @@ -283,7 +283,7 @@ func TestGetCurrencies(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveCurrencies(); err != nil { + if _, err = d.WSRetriveCurrencies(); err != nil { t.Error(err) } } @@ -335,7 +335,7 @@ func TestGetHistoricalVolatility(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveHistoricalVolatility(currencySOL); err != nil { + if _, err = d.WSRetriveHistoricalVolatility(currencySOL); err != nil { t.Error(err) } } @@ -357,7 +357,7 @@ func TestGetIndexPrice(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveIndexPrice("ada_usd"); err != nil { + if _, err = d.WSRetriveIndexPrice("ada_usd"); err != nil { t.Error(err) } } @@ -573,7 +573,7 @@ func TestGetTradeVolumes(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveTradeVolumes(false); err != nil { + if _, err = d.WSRetriveTradeVolumes(false); err != nil { t.Error(err) } } @@ -584,7 +584,7 @@ func TestGetTradingViewChartData(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetrivesTradingViewChartData(btcPerpInstrument, "60", time.Now().Add(-time.Hour), time.Now()); err != nil { + if _, err = d.WSRetrivesTradingViewChartData(btcPerpInstrument, "60", time.Now().Add(-time.Hour), time.Now()); err != nil { t.Error(err) } } @@ -595,7 +595,7 @@ func TestGetVolatilityIndexData(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveVolatilityIndexData(currencyBTC, "60", time.Now().Add(-time.Hour), time.Now()); err != nil { + if _, err = d.WSRetriveVolatilityIndexData(currencyBTC, "60", time.Now().Add(-time.Hour), time.Now()); err != nil { t.Error(err) } } @@ -606,7 +606,7 @@ func TestGetPublicTicker(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetrivePublicTicker(btcPerpInstrument); err != nil { + if _, err = d.WSRetrivePublicTicker(btcPerpInstrument); err != nil { t.Error(err) } } @@ -634,7 +634,7 @@ func TestCancelTransferByID(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSCancelTransferByID(currencyBTC, "", 23487); err != nil { + if _, err = d.WSCancelTransferByID(currencyBTC, "", 23487); err != nil { t.Error(err) } } @@ -648,7 +648,7 @@ func TestGetTransfers(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveTransfers(currencyBTC, 0, 0); err != nil { + if _, err = d.WSRetriveTransfers(currencyBTC, 0, 0); err != nil { t.Error(err) } } @@ -662,7 +662,7 @@ func TestCancelWithdrawal(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "withdrawal with given id and currency not found") { t.Error(err) } - if _, err := d.WSCancelWithdrawal(currencyBTC, 123844); err != nil && !strings.Contains(err.Error(), "withdrawal with given id and currency not found") { + if _, err = d.WSCancelWithdrawal(currencyBTC, 123844); err != nil && !strings.Contains(err.Error(), "withdrawal with given id and currency not found") { t.Error(err) } } @@ -690,7 +690,7 @@ func TestGetCurrentDepositAddress(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "max_addr_count_exceeded") { t.Error(err) } - if _, err := d.WSRetriveCurrentDepositAddress(currencyETH); err != nil && !strings.Contains(err.Error(), "max_addr_count_exceeded") { + if _, err = d.WSRetriveCurrentDepositAddress(currencyETH); err != nil && !strings.Contains(err.Error(), "max_addr_count_exceeded") { t.Error(err) } } @@ -718,7 +718,7 @@ func TestGetWithdrawals(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveWithdrawals(currencyBTC, 25, 0); err != nil { + if _, err = d.WSRetriveWithdrawals(currencyBTC, 25, 0); err != nil { t.Error(err) } } @@ -732,7 +732,7 @@ func TestSubmitTransferToSubAccount(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "transfer_not_allowed") { t.Error(err) } - if _, err := d.WSSubmitTransferToSubAccount(currencyBTC, 0.01, 13434); err != nil && !strings.Contains(err.Error(), "transfer_not_allowed") { + if _, err = d.WSSubmitTransferToSubAccount(currencyBTC, 0.01, 13434); err != nil && !strings.Contains(err.Error(), "transfer_not_allowed") { t.Error(err) } } @@ -746,7 +746,7 @@ func TestSubmitTransferToUser(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "transfer_not_allowed") { t.Error(err) } - if _, err := d.WSSubmitTransferToUser(currencyBTC, "", "0x4aa0753d798d668056920094d65321a8e8913e26", 0.001); err != nil { + if _, err = d.WSSubmitTransferToUser(currencyBTC, "", "0x4aa0753d798d668056920094d65321a8e8913e26", 0.001); err != nil { t.Error(err) } } @@ -760,7 +760,7 @@ func TestSubmitWithdraw(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSubmitWithdraw(currencyBTC, core.BitcoinDonationAddress, "", 0.001); err != nil { + if _, err = d.WSSubmitWithdraw(currencyBTC, core.BitcoinDonationAddress, "", 0.001); err != nil { t.Error(err) } } @@ -771,7 +771,7 @@ func TestGetAnnouncements(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveAnnouncements(time.Now(), 5); err != nil { + if _, err = d.WSRetriveAnnouncements(time.Now(), 5); err != nil { t.Error(err) } } @@ -824,7 +824,7 @@ func TestChangeAPIKeyName(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSChangeAPIKeyName(1, "TestKey123"); err != nil { + if _, err = d.WSChangeAPIKeyName(1, "TestKey123"); err != nil { t.Error(err) } } @@ -838,7 +838,7 @@ func TestChangeScopeInAPIKey(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSChangeScopeInAPIKey(1, "account:read_write"); err != nil { + if _, err = d.WSChangeScopeInAPIKey(1, "account:read_write"); err != nil { t.Error(err) } } @@ -852,7 +852,7 @@ func TestChangeSubAccountName(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } - if _, err := d.WSChangeSubAccountName(1, "new_sub"); err != nil && !strings.Contains(err.Error(), "unauthorized") { + if _, err = d.WSChangeSubAccountName(1, "new_sub"); err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } } @@ -866,7 +866,7 @@ func TestCreateAPIKey(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSCreateAPIKey("account:read_write", "new_sub", false); err != nil { + if _, err = d.WSCreateAPIKey("account:read_write", "new_sub", false); err != nil { t.Error(err) } } @@ -880,7 +880,7 @@ func TestCreateSubAccount(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSCreateSubAccount(); err != nil { + if _, err = d.WSCreateSubAccount(); err != nil { t.Error(err) } } @@ -894,7 +894,7 @@ func TestDisableAPIKey(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSDisableAPIKey(1); err != nil { + if _, err = d.WSDisableAPIKey(1); err != nil { t.Error(err) } } @@ -909,7 +909,7 @@ func TestDisableTFAForSubAccount(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "Method not found") { // this functionality is removed by now. t.Error(err) } - if _, err := d.WSDisableTFAForSubAccount(1); err != nil && !strings.Contains(err.Error(), "Method not found") { // this functionality is removed by now. + if _, err = d.WSDisableTFAForSubAccount(1); err != nil && !strings.Contains(err.Error(), "Method not found") { // this functionality is removed by now. t.Error(err) } } @@ -951,7 +951,7 @@ func TestGetAffiliateProgramInfo(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveAffiliateProgramInfo(1); err != nil { + if _, err = d.WSRetriveAffiliateProgramInfo(1); err != nil { t.Error(err) } } @@ -965,7 +965,7 @@ func TestGetEmailLanguage(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveEmailLanguage(); err != nil { + if _, err = d.WSRetriveEmailLanguage(); err != nil { t.Error(err) } } @@ -1007,7 +1007,7 @@ func TestGetPosition(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetrivePosition(btcPerpInstrument); err != nil { + if _, err = d.WSRetrivePosition(btcPerpInstrument); err != nil { t.Error(err) } } @@ -1021,7 +1021,7 @@ func TestGetSubAccounts(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveSubAccounts(false); err != nil { + if _, err = d.WSRetriveSubAccounts(false); err != nil { t.Error(err) } } @@ -1135,7 +1135,7 @@ func TestRemoveSubAccount(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } - if _, err := d.WSRemoveSubAccount(1); err != nil && !strings.Contains(err.Error(), "unauthorized") { + if _, err = d.WSRemoveSubAccount(1); err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } } @@ -1149,7 +1149,7 @@ func TestResetAPIKey(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSResetAPIKey(1); err != nil { + if _, err = d.WSResetAPIKey(1); err != nil { t.Error(err) } } @@ -1188,7 +1188,7 @@ func TestSetEmailLanguage(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSetEmailLanguage("en"); err != nil { + if _, err = d.WSSetEmailLanguage("en"); err != nil { t.Error(err) } } @@ -1217,7 +1217,7 @@ func TestToggleNotificationsFromSubAccount(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } - if _, err := d.WSToggleNotificationsFromSubAccount(1, false); err != nil && !strings.Contains(err.Error(), "unauthorized") { + if _, err = d.WSToggleNotificationsFromSubAccount(1, false); err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } } @@ -1252,7 +1252,7 @@ func TestToggleSubAccountLogin(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } - if _, err := d.WSToggleSubAccountLogin(1, false); err != nil && !strings.Contains(err.Error(), "unauthorized") { + if _, err = d.WSToggleSubAccountLogin(1, false); err != nil && !strings.Contains(err.Error(), "unauthorized") { t.Error(err) } } @@ -1322,7 +1322,7 @@ func TestEditOrderByLabel(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "order_not_found") { t.Error(err) } - if _, err := d.WSEditOrderByLabel(&OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument, + if _, err = d.WSEditOrderByLabel(&OrderBuyAndSellParams{Label: "incorrectUserLabel", Instrument: btcPerpInstrument, Advanced: "", Amount: 1, Price: 30000, TriggerPrice: 0, PostOnly: false, ReduceOnly: false, RejectPostOnly: false, MMP: false}); err != nil && !strings.Contains(err.Error(), "order_not_found") { t.Error(err) } @@ -1351,7 +1351,7 @@ func TestSubmitCancelAll(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSubmitCancelAll(); err != nil { + if _, err = d.WSSubmitCancelAll(); err != nil { t.Error(err) } } @@ -1365,7 +1365,7 @@ func TestSubmitCancelAllByCurrency(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSubmitCancelAllByCurrency(currencyBTC, "option", ""); err != nil { + if _, err = d.WSSubmitCancelAllByCurrency(currencyBTC, "option", ""); err != nil { t.Error(err) } } @@ -1379,7 +1379,7 @@ func TestSubmitCancelAllByInstrument(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSubmitCancelAllByInstrument(btcPerpInstrument, "all"); err != nil { + if _, err = d.WSSubmitCancelAllByInstrument(btcPerpInstrument, "all"); err != nil { t.Error(err) } } @@ -1393,7 +1393,7 @@ func TestSubmitCancelByLabel(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSSubmitCancelByLabel("incorrectOrderLabel", ""); err != nil { + if _, err = d.WSSubmitCancelByLabel("incorrectOrderLabel", ""); err != nil { t.Error(err) } } @@ -1407,7 +1407,7 @@ func TestSubmitClosePosition(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "already_closed") { t.Error(err) } - if _, err := d.WSSubmitClosePosition(btcPerpInstrument, "limit", 35000); err != nil && !strings.Contains(err.Error(), "already_closed") { + if _, err = d.WSSubmitClosePosition(btcPerpInstrument, "limit", 35000); err != nil && !strings.Contains(err.Error(), "already_closed") { t.Error(err) } } @@ -1421,7 +1421,7 @@ func TestGetMargins(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveMargins(btcPerpInstrument, 5, 35000); err != nil { + if _, err = d.WSRetriveMargins(btcPerpInstrument, 5, 35000); err != nil { t.Error(err) } } @@ -1435,7 +1435,7 @@ func TestGetMMPConfig(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "MMP disabled") { t.Error(err) } - if _, err := d.WSRetriveMMPConfig(currencyETH); err != nil && !strings.Contains(err.Error(), "MMP disabled") { + if _, err = d.WSRetriveMMPConfig(currencyETH); err != nil && !strings.Contains(err.Error(), "MMP disabled") { t.Error(err) } } @@ -1463,7 +1463,7 @@ func TestGetOpenOrdersByInstrument(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveOpenOrdersByInstrument(btcPerpInstrument, "all"); err != nil { + if _, err = d.WSRetriveOpenOrdersByInstrument(btcPerpInstrument, "all"); err != nil { t.Error(err) } } @@ -1565,7 +1565,7 @@ func TestGetUserTradesByCurrencyAndTime(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveUserTradesByCurrencyAndTime(currencyETH, "future", "default", 5, false, time.Now().Add(-time.Hour*10), time.Now().Add(-time.Hour*1)); err != nil { + if _, err = d.WSRetriveUserTradesByCurrencyAndTime(currencyETH, "future", "default", 5, false, time.Now().Add(-time.Hour*10), time.Now().Add(-time.Hour*1)); err != nil { t.Error(err) } } @@ -1579,7 +1579,7 @@ func TestGetUserTradesByInstrument(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveUserTradesByInstrument(btcPerpInstrument, "asc", 5, 10, 4, true); err != nil { + if _, err = d.WSRetriveUserTradesByInstrument(btcPerpInstrument, "asc", 5, 10, 4, true); err != nil { t.Error(err) } } @@ -1593,7 +1593,7 @@ func TestGetUserTradesByInstrumentAndTime(t *testing.T) { if err != nil { t.Error(err) } - if _, err := d.WSRetriveUserTradesByInstrumentAndTime(btcPerpInstrument, "asc", 10, false, time.Now().Add(-time.Hour), time.Now()); err != nil { + if _, err = d.WSRetriveUserTradesByInstrumentAndTime(btcPerpInstrument, "asc", 10, false, time.Now().Add(-time.Hour), time.Now()); err != nil { t.Error(err) } } @@ -1607,7 +1607,7 @@ func TestGetUserTradesByOrder(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "order_not_found") { t.Error(err) } - if _, err := d.WSRetriveUserTradesByOrder("wrongOrderID", "default"); err != nil && !strings.Contains(err.Error(), "order_not_found") { + if _, err = d.WSRetriveUserTradesByOrder("wrongOrderID", "default"); err != nil && !strings.Contains(err.Error(), "order_not_found") { t.Error(err) } } @@ -1621,7 +1621,7 @@ func TestResetMMP(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "MMP disabled") { t.Error(err) } - if _, err := d.WSResetMMP(currencyBTC); err != nil && !strings.Contains(err.Error(), "MMP disabled") { + if _, err = d.WSResetMMP(currencyBTC); err != nil && !strings.Contains(err.Error(), "MMP disabled") { t.Error(err) } } @@ -1635,7 +1635,7 @@ func TestSendRFQ(t *testing.T) { if err != nil && !strings.Contains(err.Error(), "not_enough_funds") { t.Error(err) } - if _, err := d.WSSendRFQ("BTC-PERPETUAL", 1000, order.Buy); err != nil && !strings.Contains(err.Error(), "not_enough_funds") { + if _, err = d.WSSendRFQ("BTC-PERPETUAL", 1000, order.Buy); err != nil && !strings.Contains(err.Error(), "not_enough_funds") { t.Error(err) } } diff --git a/exchanges/deribit/deribit_types.go b/exchanges/deribit/deribit_types.go index 99b7ce8ec38..e5df46c8aa7 100644 --- a/exchanges/deribit/deribit_types.go +++ b/exchanges/deribit/deribit_types.go @@ -35,7 +35,6 @@ var ( errInvalidInstrumentName = errors.New("invalid instrument name") errInvalidComboID = errors.New("invalid combo ID") errInvalidCurrency = errors.New("invalid currency") - errInvalidComboState = errors.New("invalid combo state") errNoArgumentPassed = errors.New("no argument passed") errInvalidAmount = errors.New("invalid amount, must be greater than 0") errMissingNonce = errors.New("missing nonce") @@ -48,7 +47,6 @@ var ( errInvalidEmailAddress = errors.New("invalid email address") errMalformedData = errors.New("malformed data") errInvalidResponseReceiver = errors.New("invalid response receiver; must be a non nil pointer") - errDisconnectedConnection = errors.New("websocket connection is not established") errWebsocketConnectionNotAuthenticated = errors.New("websocket connection is not authenticated") ) @@ -114,20 +112,6 @@ type FundingChartData struct { } `json:"data"` } -// FundingRateHistoryData stores data for funding rate history -type FundingRateHistoryData struct { - Timestamp int64 `json:"timestamp"` - IndexPrice float64 `json:"index_price"` - PrevIndexPrice float64 `json:"prev_index_price"` - Interest8H float64 `json:"interest_8h"` - Interest1H float64 `json:"interest_1h"` -} - -// FundingRateValueData stores funding rate for the requested period -type FundingRateValueData struct { - Result float64 `json:"result"` -} - // HistoricalVolatilityData stores volatility data for requested symbols type HistoricalVolatilityData struct { Timestamp float64 @@ -381,12 +365,6 @@ type TransferData struct { UpdatedTimestamp int64 `json:"updated_timestamp"` } -// TransfersData stores data of transfers -type TransfersData struct { - Count int64 `json:"count"` - Data []TransferData `json:"data"` -} - // WithdrawData stores data of withdrawal type WithdrawData struct { Address string `json:"address"` @@ -505,28 +483,6 @@ type MMPConfigData struct { QuantityLimit float64 `json:"quantity_limit"` } -// OrderMarginData stores data for order margins -type OrderMarginData struct { - OrderID string `json:"order_id"` - InitialMargin float64 `json:"initial_margin"` -} - -// TriggerOrderData stores data for trigger orders -type TriggerOrderData struct { - Trigger string `json:"trigger"` - Timestamp int64 `json:"timestamp"` - TriggerPrice float64 `json:"trigger_price"` - TriggerOrderID string `json:"trigger_order_id"` - OrderState string `json:"order_state"` - Request string `json:"request"` - Price float64 `json:"price"` - OrderID int64 `json:"order_id"` - Offset int64 `json:"offset"` - InstrumentName string `json:"instrument_name"` - Amount float64 `json:"amount"` - Direction string `json:"direction"` -} - // UserTradesData stores data of user trades type UserTradesData struct { Trades []UserTradeData `json:"trades"` @@ -729,12 +685,6 @@ type TransactionsData struct { Continuation int64 `json:"continuation"` } -// PlaceTradeData stores data of a private trade/order -type PlaceTradeData struct { - Trades []PrivateTradeData `json:"trades"` - Order OrderData `json:"order"` -} - // wsInput defines a request obj for the JSON-RPC login and gets a websocket // response type wsInput struct { @@ -773,14 +723,6 @@ type wsResponse struct { } `json:"error,omitempty"` } -type wsSubmitOrderResponse struct { - JSONRPCVersion string `json:"jsonrpc"` - ID int64 `json:"id"` - Method string `json:"method"` - Result *PrivateTradeData `json:"result"` - Error *UnmarshalError `json:"error"` -} - type wsLoginResponse struct { JSONRPCVersion string `json:"jsonrpc"` ID int64 `json:"id"`