diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 925866c..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.20' - - - name: Build - run: go build -v ./... - - - name: Test - run: go test -v ./... diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 1c2fda5..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/bybit.go.api.iml b/.idea/bybit.go.api.iml deleted file mode 100644 index 338a266..0000000 --- a/.idea/bybit.go.api.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 7288a09..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index f245aa7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/account.go b/account.go index ccf993c..f409177 100644 --- a/account.go +++ b/account.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type AccountClient struct { diff --git a/asset.go b/asset.go index dc08e92..2f22be4 100644 --- a/asset.go +++ b/asset.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type AssetClient struct { @@ -471,6 +472,7 @@ func (s *AssetClient) GetWithdrawalAmount(ctx context.Context, opts ...RequestOp } return res, nil } + func (s *AssetClient) GetWithdrawalRecords(ctx context.Context, opts ...RequestOption) (res *ServerResponse, err error) { r := &request{ method: http.MethodGet, diff --git a/broker.go b/broker.go index a68b1c6..bc46b13 100644 --- a/broker.go +++ b/broker.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type BrokerServiceClient struct { diff --git a/bybit_api_client.go b/bybit_api_client.go index b13a9b7..871ad84 100644 --- a/bybit_api_client.go +++ b/bybit_api_client.go @@ -14,9 +14,9 @@ import ( "strconv" "time" + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" "github.com/bitly/go-simplejson" jsoniter "github.com/json-iterator/go" - "github.com/wuhewuhe/bybit.go.api/handlers" ) var json = jsoniter.ConfigCompatibleWithStandardLibrary @@ -199,9 +199,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption) c.debug("response status code: %d", res.StatusCode) if res.StatusCode >= http.StatusBadRequest { - var ( - apiErr = new(handlers.APIError) - ) + apiErr := new(handlers.APIError) e := json.Unmarshal(data, apiErr) if e != nil { c.debug("failed to unmarshal json: %s", e) @@ -310,7 +308,6 @@ func (c *Client) NewPositionService(params map[string]interface{}) *PositionClie c: c, params: params, } - } func (c *Client) NewPreUpgradeService(params map[string]interface{}) *PreUpgradeClient { diff --git a/examples/Account/get_transaction.go b/examples/Account/get_transaction.go index b36271c..776728e 100644 --- a/examples/Account/get_transaction.go +++ b/examples/Account/get_transaction.go @@ -3,7 +3,8 @@ package main import ( "context" "fmt" - bybit "github.com/wuhewuhe/bybit.go.api" + + bybit "gitea.computernetthings.ru/yash/bybit.go.api" ) func main() { diff --git a/examples/Asset/get_coin_info.go b/examples/Asset/get_coin_info.go index 2875c42..9844f42 100644 --- a/examples/Asset/get_coin_info.go +++ b/examples/Asset/get_coin_info.go @@ -3,7 +3,8 @@ package main import ( "context" "fmt" - bybit "github.com/wuhewuhe/bybit.go.api" + + bybit "gitea.computernetthings.ru/yash/bybit.go.api" ) func main() { diff --git a/examples/Asset/get_transfer_coin.go b/examples/Asset/get_transfer_coin.go index 2c7c5fb..97eddde 100644 --- a/examples/Asset/get_transfer_coin.go +++ b/examples/Asset/get_transfer_coin.go @@ -3,7 +3,8 @@ package main import ( "context" "fmt" - bybit "github.com/wuhewuhe/bybit.go.api" + + bybit "gitea.computernetthings.ru/yash/bybit.go.api" ) func main() { diff --git a/examples/Trade/place_batch_trade.go b/examples/Trade/place_batch_trade.go index bae2836..0113cb1 100644 --- a/examples/Trade/place_batch_trade.go +++ b/examples/Trade/place_batch_trade.go @@ -3,7 +3,8 @@ package main import ( "context" "fmt" - bybit "github.com/wuhewuhe/bybit.go.api" + + bybit "gitea.computernetthings.ru/yash/bybit.go.api" ) func main() { @@ -12,7 +13,8 @@ func main() { func PlaceBatchTrade() { client := bybit.NewBybitHttpClient("8wYkmpLsMg10eNQyPm", "Ouxc34myDnXvei54XsBZgoQzfGxO4bkr2Zsj", bybit.WithBaseURL(bybit.TESTNET)) - params := map[string]interface{}{"category": "option", + params := map[string]interface{}{ + "category": "option", "request": []map[string]interface{}{ { "category": "option", diff --git a/examples/Trade/place_order.go b/examples/Trade/place_order.go index e640850..4acb740 100644 --- a/examples/Trade/place_order.go +++ b/examples/Trade/place_order.go @@ -3,7 +3,8 @@ package main import ( "context" "fmt" - bybit "github.com/wuhewuhe/bybit.go.api" + + bybit "gitea.computernetthings.ru/yash/bybit.go.api" ) func main() { diff --git a/go.mod b/go.mod index cb1ade5..4d856dd 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/wuhewuhe/bybit.go.api +module gitea.computernetthings.ru/yash/bybit.go.api go 1.21 diff --git a/go.sum b/go.sum index 3b3cac7..53db67c 100644 --- a/go.sum +++ b/go.sum @@ -10,7 +10,6 @@ github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/ github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= diff --git a/lending.go b/lending.go index 3e43085..6a53b7a 100644 --- a/lending.go +++ b/lending.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type LendingServiceClient struct { diff --git a/market_service.go b/market_service.go index a660dc1..1f73654 100644 --- a/market_service.go +++ b/market_service.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/wuhewuhe/bybit.go.api/models" + "gitea.computernetthings.ru/yash/bybit.go.api/models" ) // MarketKlinesService Market Kline (GET /v5/market/kline) diff --git a/market_service_test.go b/market_service_test.go index 5c85684..fa16ad6 100644 --- a/market_service_test.go +++ b/market_service_test.go @@ -4,8 +4,8 @@ import ( "net/http" "testing" + "gitea.computernetthings.ru/yash/bybit.go.api/models" "github.com/stretchr/testify/suite" - "github.com/wuhewuhe/bybit.go.api/models" ) type marketTestSuite struct { @@ -128,6 +128,7 @@ func (s *marketTestSuite) assertMarketKlineEqual(expected, actual *models.Market r.Equal(len(expected.List), len(actual.List), "List") r.Equal(expected.List, actual.List) } + func (s *marketTestSuite) TestMarketMarkPriceKline() { data := []byte(`{ "retCode": 0, @@ -1296,6 +1297,7 @@ func (s *marketTestSuite) assertMarketLongShortRatioInfoEqual(expected, actual * r := s.r() r.Equal(expected.List, actual.List, "List") } + func (s *marketTestSuite) TestGetServerTime() { data := []byte(`{ "retCode": 0, diff --git a/position.go b/position.go index e331d61..5e71e2d 100644 --- a/position.go +++ b/position.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type PositionClient struct { diff --git a/pre_upgrade.go b/pre_upgrade.go index 84b2041..f38e54f 100644 --- a/pre_upgrade.go +++ b/pre_upgrade.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type PreUpgradeClient struct { diff --git a/spot_leverage.go b/spot_leverage.go index 58e7fae..3f14572 100644 --- a/spot_leverage.go +++ b/spot_leverage.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type SpotLeverageClient struct { diff --git a/spot_margin.go b/spot_margin.go index f7bb9ab..9db71f8 100644 --- a/spot_margin.go +++ b/spot_margin.go @@ -3,8 +3,9 @@ package bybit_connector import ( "context" "errors" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type SpotMarginClient struct { diff --git a/trade.go b/trade.go index 4f674bc..7975425 100644 --- a/trade.go +++ b/trade.go @@ -2,9 +2,10 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" - "github.com/wuhewuhe/bybit.go.api/models" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" + "gitea.computernetthings.ru/yash/bybit.go.api/models" ) type TradeClient struct { diff --git a/user.go b/user.go index fe08604..8d05671 100644 --- a/user.go +++ b/user.go @@ -2,8 +2,9 @@ package bybit_connector import ( "context" - "github.com/wuhewuhe/bybit.go.api/handlers" "net/http" + + "gitea.computernetthings.ru/yash/bybit.go.api/handlers" ) type UserServiceClient struct {