exchanges: Types and unmarshalling methods update (#1899)

* Added TimeInForce type and updated related files

* Linter issue fix and minor coinbasepro type update

* Bitrex consts update

* added unit test and minor changes in bittrex

* Unit tests update

* Fix minor linter issues

* Update TestStringToTimeInForce unit test

* fix conflict with gateio timeInForce

* Update order tests

* Complete updating the order unit tests

* update kucoin and deribit wrapper to match the time in force change

* fix time-in-force related test errors

* linter issue fix

* time in force constants, functions and unit tests update

* shift tif policies to TimeInForce

* Update time-in-force, related functions, and unit tests

* fix linter issue and time-in-force processing

* added a good till crossing tif value

* order type fix and fix related tim-in-force entries

* update time-in-force unmarshaling and unit test

* fix time-in-force error in gateio

* linter issue fix

* update based on review comments

* add unit test and fix missing issues

* minor fix and added benchmark unit test

* change GTT to GTC for limit

* fix linter issue

* added time-in-force value to place order param

* fix minor issues based on review comment and move tif code to separate files

* update on exchanges linked to time-in-force

* resolve missing review comments

* minor linter issues fix

* added time-in-force handler and update timeInForce parametered endpoint

* minor fixes based on review

* nits fix

* update based on review

* linter fix

* rm getTimeInForce func and minor change to time-in-force

* minor change

* update based on review comments

* wrappers and time-in-force calling approach

* update slice data processing

* fix linter issues

* remove unnecessary Unmarshal methods and replace type delatration and added unit tests

* minor change

* minor changes to types

* update gateio string to timeInForce conversion and unit test

* removed unused timeInForceString func from kraken

* removed redundant parentheses in slice unmarshaling

* array to slice conversion and other updates

* reverted slice target to array

* Binanceus unit test NotNil check to Len check

* change NotNil to Len check

* rename unmarshal unit test funcs name

* wrap json strings with []byte
This commit is contained in:
Samuael A.
2025-06-02 06:54:49 +03:00
committed by GitHub
parent 8fa6179f65
commit 0e9adcd1e1
28 changed files with 483 additions and 1095 deletions

View File

@@ -1691,12 +1691,12 @@ func (g *Gateio) GetHistoricCandles(ctx context.Context, pair currency.Pair, a a
listCandlesticks = make([]kline.Candle, len(candles))
for i := range candles {
listCandlesticks[i] = kline.Candle{
Time: candles[i].Timestamp,
Open: candles[i].OpenPrice,
High: candles[i].HighestPrice,
Low: candles[i].LowestPrice,
Close: candles[i].ClosePrice,
Volume: candles[i].QuoteCcyVolume,
Time: candles[i].Timestamp.Time(),
Open: candles[i].OpenPrice.Float64(),
High: candles[i].HighestPrice.Float64(),
Low: candles[i].LowestPrice.Float64(),
Close: candles[i].ClosePrice.Float64(),
Volume: candles[i].BaseCcyAmount.Float64(),
}
}
case asset.CoinMarginedFutures, asset.USDTMarginedFutures, asset.DeliveryFutures:
@@ -1746,12 +1746,12 @@ func (g *Gateio) GetHistoricCandlesExtended(ctx context.Context, pair currency.P
}
for j := range candles {
candlestickItems = append(candlestickItems, kline.Candle{
Time: candles[j].Timestamp,
Open: candles[j].OpenPrice,
High: candles[j].HighestPrice,
Low: candles[j].LowestPrice,
Close: candles[j].ClosePrice,
Volume: candles[j].QuoteCcyVolume,
Time: candles[j].Timestamp.Time(),
Open: candles[j].OpenPrice.Float64(),
High: candles[j].HighestPrice.Float64(),
Low: candles[j].LowestPrice.Float64(),
Close: candles[j].ClosePrice.Float64(),
Volume: candles[j].QuoteCcyVolume.Float64(),
})
}
case asset.CoinMarginedFutures, asset.USDTMarginedFutures, asset.DeliveryFutures: