Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nntaoli committed May 14, 2020
2 parents 7b72bf8 + aaae58e commit 68fcdbf
Show file tree
Hide file tree
Showing 29 changed files with 134 additions and 3,365 deletions.
3 changes: 2 additions & 1 deletion FutureRestAPI.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ type FutureRestAPI interface {

/**
*全仓账户
*@param currency
*/
GetFutureUserinfo() (*FutureAccount, error)
GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error)

/**
* @deprecated
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div align="center">
<img width="409" heigth="205" src="https://upload-images.jianshu.io/upload_images/6760989-dec7dc747846880e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" alt="goex">
<img src="https://travis-ci.org/nntaoli-project/goex.svg?branch=dev"/>
<br/>
[![](logo.png)] (https://www.jetbrains.com/?from=goex)
</div>

### goex目标
Expand Down
5 changes: 3 additions & 2 deletions binance/BinanceSwap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package binance
import (
"errors"
"fmt"
. "github.com/nntaoli-project/goex"
"net/url"
"strconv"
"sync"
"time"

. "github.com/nntaoli-project/goex"
)

const (
Expand Down Expand Up @@ -234,7 +235,7 @@ func (bs *BinanceSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error
/**
*全仓账户
*/
func (bs *BinanceSwap) GetFutureUserinfo() (*FutureAccount, error) {
func (bs *BinanceSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) {
params := url.Values{}
bs.buildParamsSigned(&params)
path := bs.apiV1 + ACCOUNT_URI + params.Encode()
Expand Down
5 changes: 3 additions & 2 deletions bitmex/bitmex.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"encoding/json"
"errors"
"fmt"
. "github.com/nntaoli-project/goex/internal/logger"
"net/url"
"strings"
"time"

. "github.com/nntaoli-project/goex/internal/logger"

. "github.com/nntaoli-project/goex"
)

Expand Down Expand Up @@ -67,7 +68,7 @@ func (bm *bitmex) toJson(param interface{}) string {
return string(dataJson)
}

func (bm *bitmex) GetFutureUserinfo() (*FutureAccount, error) {
func (bm *bitmex) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) {
uri := "/api/v1/user/margin?currency=XBt"
var resp struct {
Currency string `json:"currency"`
Expand Down
31 changes: 6 additions & 25 deletions builder/APIBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package builder
import (
"context"
"fmt"

. "github.com/nntaoli-project/goex"
"github.com/nntaoli-project/goex/bigone"
"github.com/nntaoli-project/goex/binance"
Expand All @@ -12,13 +13,16 @@ import (
"github.com/nntaoli-project/goex/bitstamp"
"github.com/nntaoli-project/goex/bittrex"
"github.com/nntaoli-project/goex/coinbene"
"github.com/nntaoli-project/goex/fmex"
"github.com/nntaoli-project/goex/kucoin"

"github.com/nntaoli-project/goex/atop"
//"github.com/nntaoli-project/goex/coin58"
"net"
"net/http"
"net/url"
"time"

"github.com/nntaoli-project/goex/coinex"
"github.com/nntaoli-project/goex/fcoin"
"github.com/nntaoli-project/goex/gateio"
"github.com/nntaoli-project/goex/gdax"
"github.com/nntaoli-project/goex/hitbtc"
Expand All @@ -27,10 +31,6 @@ import (
"github.com/nntaoli-project/goex/okex"
"github.com/nntaoli-project/goex/poloniex"
"github.com/nntaoli-project/goex/zb"
"net"
"net/http"
"net/url"
"time"
)

type APIBuilder struct {
Expand Down Expand Up @@ -238,17 +238,6 @@ func (builder *APIBuilder) Build(exName string) (api API) {
_api = zb.New(builder.client, builder.apiKey, builder.secretkey)
case COINEX:
_api = coinex.New(builder.client, builder.apiKey, builder.secretkey)
case FCOIN:
// _api = fcoin.NewFCoin(builder.client, builder.apiKey, builder.secretkey)
_api = fcoin.NewWithConfig(&APIConfig{
HttpClient: builder.client,
Endpoint: builder.endPoint,
ApiKey: builder.apiKey,
ApiSecretKey: builder.secretkey})
case FCOIN_MARGIN:
_api = fcoin.NewFcoinMargin(builder.client, builder.apiKey, builder.secretkey)
//case COIN58:
// _api = coin58.New58Coin(builder.client, builder.apiKey, builder.secretkey)
case BIGONE:
_api = bigone.New(builder.client, builder.apiKey, builder.secretkey)
case HITBTC:
Expand Down Expand Up @@ -308,14 +297,6 @@ func (builder *APIBuilder) BuildFuture(exName string) (api FutureRestAPI) {
ApiKey: builder.apiKey,
ApiSecretKey: builder.secretkey,
})
case FMEX:
return fmex.NewFMexSwap(&APIConfig{
HttpClient: builder.client,
//Endpoint: "https://api.fmex.com",
Endpoint: builder.futuresEndPoint,
ApiKey: builder.apiKey,
ApiSecretKey: builder.secretkey,
})

case BINANCE, BINANCE_SWAP:
return binance.NewBinanceSwap(&APIConfig{
Expand Down
5 changes: 3 additions & 2 deletions coinbene/CoinbeneSwap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"encoding/json"
"errors"
"fmt"
. "github.com/nntaoli-project/goex"
"net/http"
"sort"
"strings"
"time"

. "github.com/nntaoli-project/goex"
)

type baseResp struct {
Expand Down Expand Up @@ -132,7 +133,7 @@ func (swap *CoinbeneSwap) GetFutureDepth(currencyPair CurrencyPair, contractType

func (swap *CoinbeneSwap) GetFutureIndex(currencyPair CurrencyPair) (float64, error) { panic("") }

func (swap *CoinbeneSwap) GetFutureUserinfo() (*FutureAccount, error) {
func (swap *CoinbeneSwap) GetFutureUserinfo(currencyPair ...CurrencyPair) (*FutureAccount, error) {
var data struct {
AvailableBalance float64 `json:"availableBalance,string"`
FrozenBalance float64 `json:"frozenBalance,string"`
Expand Down
Loading

0 comments on commit 68fcdbf

Please sign in to comment.