exchanges: Update GateIO exchange to V4 (#1058)

* Adding Public Endpoints and test functions

* Adding public endpoints and test functions

* Adding private spot endpoints

* Adding private endpoints and corresponding tests for margin

* Adding Margin Private endpoints

* Adding cross margin and flash swap endpoints

* Adding futures private endpoints

* Adding futures private endpoints and corresponding tests

* Adding Options and SubAccount endpoints and their unit tests

* Adding Wrapper functions

* Complete wrapper functions and corresponding unit test functions

* Fixing wrapper issues and adding websocket functions

* Update of Spot websocket and adding futures websocket handlers

* completed futures WS push data endpoints

* Completed Options websocket endpoints

* Adding websocket support for delivery futures and slight update on endpoint funcs

* Added Delivery websocket support and fix linter issues

* Update on Unit tests

* fix slight currency format error

* Fix slight endpoint tempos

* Update on conditional statements and unit tests issues

* fixing slight tempos

* Slight model and websocket data push method change

* Fix unit test tempos and updating models

* Fix on code structures and update on unit tests

* Slight code fix

* Remove print statements

* Update on tradable pairs fetch eps

* Fix websocket tempos

* Adding types to websocket routine manager

* Fix slight issues

* Slight fixes

* Updating wrapper funcs and models

* Slight update

* Update on test

* Update on tradable pairs

* update conditional statements

* Fixing slight issues

* Updating unit tests

* Minor fixes depending review comments

* Remove redundant method declaration

* Adding missing intervals

* Updating fetch tradable pairs

* update tradable pairs issues

* Addressing small tempos

* Slight fix on ticker

* Minor Fixes

* Minor review comment fixes

* Unit test and minor code updates

* Slight code updates

* Minor updates depending review comments

* Fixes

* Updating incoming message matcher

* Fix missing merge issue

* Fix minor wrapper issues

* Updating ratelimit and other issues

* Updating endpoint models and adding missing eps

* Update on code structure and models

* Minor codespell fixes

* Minor update on models

* fix unit test panic

* Minor race fix

* Fix issues in generating signature and unit tests

* Minor update on wrapper and unit tests

* Minor fix on wrapper

* Mini linter issues fix

* Minor fix

* endpoint fixes and slight update

* Minor fixes

* Updating exchange functions and unit tests

* Unit test and wrapper updates

* Remove options candlestick support

* Minor unit test and wrapper fix

* Unit test update

* minor fix on unit test and wrapper

* endpoints constants name change

* Add minor wrapper issues

* endpoint constants update

* endpoint url updates

* Updating subscriptions

* fixing dual mode endpoint methods

* minor fix

* rm small tempo

* Update on websocket orderbook handling

* Orderbook and currency pair update

* fix linter and test issues

* minor helper function update

* Fix wrapper coverage and wrapper issues

* delete unused variables

* Minor fix on ReadData() call

* separating websocket handlers

* separating websocket handlers

* Minor fix on enabled pair

* minor fix

* check instrument availability in spot

* create a separate subscriber for sake of multiple websocket connection

* linter fix

* minor websocket and gateio endpoints fix

* fix nil pointer exception

* minor fixes

* spelling fix decerializes -> deserializes

* fix Bitfinex unit test issues

* minor unknown currency pair labling fix

* minor currency pair handling fix

* slight update on GetDepositAddress wrapper unit test

* setting max request job to 200

* fixing numerical and timestamp type convert

* fix value overflow error

* change method of parsing orderbook price

* unifying timestamp conversion types to gateioTime

---------

Co-authored-by: Samuael Adnew <samuaelad@Samuaels-MacBook-Air.local>
This commit is contained in:
Samuael A
2023-05-30 04:03:53 +00:00
committed by GitHub
parent d6bff305c7
commit 3eac6d12bd
25 changed files with 14353 additions and 2871 deletions

View File

@@ -251,6 +251,12 @@ func (k *Item) FormatDates() {
// durationToWord returns english version of interval
func durationToWord(in Interval) string {
switch in {
case HundredMilliseconds:
return "hundredmillisec"
case ThousandMilliseconds:
return "thousandmillisec"
case TenSecond:
return "tensec"
case FifteenSecond:
return "fifteensecond"
case OneMin:
@@ -291,6 +297,10 @@ func durationToWord(in Interval) string {
return "twoweek"
case OneMonth:
return "onemonth"
case ThreeMonth:
return "threemonth"
case SixMonth:
return "sixmonth"
case OneYear:
return "oneyear"
default:

View File

@@ -153,6 +153,18 @@ func TestDurationToWord(t *testing.T) {
name string
interval Interval
}{
{
"hundredmillisec",
HundredMilliseconds,
},
{
"thousandmillisec",
ThousandMilliseconds,
},
{
"tensec",
TenSecond,
},
{
"FifteenSecond",
FifteenSecond,
@@ -233,6 +245,14 @@ func TestDurationToWord(t *testing.T) {
"OneMonth",
OneMonth,
},
{
"ThreeMonth",
ThreeMonth,
},
{
"SixMonth",
SixMonth,
},
{
"OneYear",
OneYear,

View File

@@ -11,32 +11,36 @@ import (
// Consts here define basic time intervals
const (
FifteenSecond = Interval(15 * time.Second)
OneMin = Interval(time.Minute)
ThreeMin = 3 * OneMin
FiveMin = 5 * OneMin
TenMin = 10 * OneMin
FifteenMin = 15 * OneMin
ThirtyMin = 30 * OneMin
OneHour = Interval(time.Hour)
TwoHour = 2 * OneHour
ThreeHour = 3 * OneHour
FourHour = 4 * OneHour
SixHour = 6 * OneHour
EightHour = 8 * OneHour
TwelveHour = 12 * OneHour
OneDay = 24 * OneHour
TwoDay = 2 * OneDay
ThreeDay = 3 * OneDay
FiveDay = 5 * OneDay
SevenDay = 7 * OneDay
FifteenDay = 15 * OneDay
OneWeek = 7 * OneDay
TwoWeek = 2 * OneWeek
OneMonth = 30 * OneDay
ThreeMonth = 3 * OneMonth
SixMonth = 6 * OneMonth
OneYear = 365 * OneDay
HundredMilliseconds = Interval(100 * time.Millisecond)
ThousandMilliseconds = 10 * HundredMilliseconds
TenSecond = Interval(10 * time.Second)
FifteenSecond = Interval(15 * time.Second)
ThirtySecond = 2 * FifteenSecond
OneMin = Interval(time.Minute)
ThreeMin = 3 * OneMin
FiveMin = 5 * OneMin
TenMin = 10 * OneMin
FifteenMin = 15 * OneMin
ThirtyMin = 30 * OneMin
OneHour = Interval(time.Hour)
TwoHour = 2 * OneHour
ThreeHour = 3 * OneHour
FourHour = 4 * OneHour
SixHour = 6 * OneHour
EightHour = 8 * OneHour
TwelveHour = 12 * OneHour
OneDay = 24 * OneHour
TwoDay = 2 * OneDay
ThreeDay = 3 * OneDay
SevenDay = 7 * OneDay
FifteenDay = 15 * OneDay
OneWeek = 7 * OneDay
TwoWeek = 2 * OneWeek
OneMonth = 30 * OneDay
ThreeMonth = 90 * OneDay
SixMonth = 2 * ThreeMonth
OneYear = 365 * OneDay
FiveDay = 5 * OneDay
)
var (
@@ -84,6 +88,9 @@ var (
// SupportedIntervals is a list of all supported intervals
SupportedIntervals = []Interval{
HundredMilliseconds,
ThousandMilliseconds,
TenSecond,
FifteenSecond,
OneMin,
ThreeMin,
@@ -100,6 +107,7 @@ var (
TwelveHour,
OneDay,
ThreeDay,
FiveDay,
SevenDay,
FifteenDay,
OneWeek,
@@ -108,6 +116,8 @@ var (
ThreeMonth,
SixMonth,
OneYear,
ThreeMonth,
SixMonth,
}
)