Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nntaoli committed Mar 5, 2020
2 parents d898ae9 + 215edd0 commit 2da2755
Show file tree
Hide file tree
Showing 109 changed files with 2,000 additions and 319 deletions.
2 changes: 1 addition & 1 deletion APIUtils.go
Expand Up @@ -3,7 +3,7 @@ package goex
import (
"errors"
"fmt"
"github.com/nntaoli-project/GoEx/internal/logger"
"github.com/nntaoli-project/goex/internal/logger"
"reflect"
"time"
)
Expand Down
2 changes: 2 additions & 0 deletions Const.go
Expand Up @@ -135,6 +135,7 @@ const (
ZB = "zb.com"
BITFINEX = "bitfinex.com"
BINANCE = "binance.com"
BINANCE_SWAP = "binance.com_swap"
POLONIEX = "poloniex.com"
COINEX = "coinex.com"
BITHUMB = "bithumb.com"
Expand All @@ -153,4 +154,5 @@ const (
CRYPTOPIA = "cryptopia.co.nz"
HBDM = "hbdm.com"
COINBENE = "coinbene.com"
ATOP = "a.top"
)
12 changes: 10 additions & 2 deletions HttpUtils.go
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/nntaoli-project/GoEx/internal/logger"
"github.com/nntaoli-project/goex/internal/logger"
"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttpproxy"
"io/ioutil"
Expand Down Expand Up @@ -63,7 +63,7 @@ func NewHttpRequestWithFasthttp(client *http.Client, reqMethod, reqUrl, postData
}

func NewHttpRequest(client *http.Client, reqType string, reqUrl string, postData string, requstHeaders map[string]string) ([]byte, error) {
logger.Log.Debug("request url: ", reqUrl)
logger.Log.Debugf("[%s] request url: %s", reqType, reqUrl)
lib := os.Getenv("HTTP_LIB")
if lib == "fasthttp" {
return NewHttpRequestWithFasthttp(client, reqType, reqUrl, postData, requstHeaders)
Expand Down Expand Up @@ -216,3 +216,11 @@ func HttpDeleteForm(client *http.Client, reqUrl string, postData url.Values, hea
headers["Content-Type"] = "application/x-www-form-urlencoded"
return NewHttpRequest(client, "DELETE", reqUrl, postData.Encode(), headers)
}

func HttpPut(client *http.Client, reqUrl string, postData url.Values, headers map[string]string) ([]byte, error) {
if headers == nil {
headers = map[string]string{}
}
headers["Content-Type"] = "application/x-www-form-urlencoded"
return NewHttpRequest(client, "PUT", reqUrl, postData.Encode(), headers)
}
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 GoEx
Copyright (c) 2017 goex

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 16 additions & 16 deletions README.md
@@ -1,15 +1,15 @@
<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"/>
<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"/>
</div>

### GoEx目标
### goex目标

GoEx项目是为了统一并标准化各个数字资产交易平台的接口而设计,同一个策略可以随时切换到任意一个交易平台,而不需要更改任何代码。
goex项目是为了统一并标准化各个数字资产交易平台的接口而设计,同一个策略可以随时切换到任意一个交易平台,而不需要更改任何代码。

[English](https://github.com/nntaoli-project/GoEx/blob/dev/README_en.md)
[English](https://github.com/nntaoli-project/goex/blob/dev/README_en.md)

### GoEx已支持交易所 `22+`
### goex已支持交易所 `22+`

| 交易所 | 行情接口 | 交易接口 | 版本号 |
| --- | --- | --- | --- |
Expand All @@ -35,14 +35,14 @@ GoEx项目是为了统一并标准化各个数字资产交易平台的接口而
| coinbig.com | Y | Y | * |
|coinbene.com|Y|Y|*|

### 安装GoEx库
### 安装goex库

``` go get github.com/nntaoli-project/GoEx ```
``` go get github.com/nntaoli-project/goex ```

>建议go mod 管理依赖
```
require (
github.com/nntaoli-project/GoEx v1.0.4
github.com/nntaoli-project/goex v1.0.4
)
```

Expand All @@ -53,8 +53,8 @@ require (
package main

import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/GoEx/builder"
"github.com/nntaoli-project/goex"
"github.com/nntaoli-project/goex/builder"
"log"
"time"
)
Expand Down Expand Up @@ -87,9 +87,9 @@ require (

```golang
import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/GoEx/huobi"
//"github.com/nntaoli-project/GoEx/okcoin"
"github.com/nntaoli-project/goex"
"github.com/nntaoli-project/goex/huobi"
//"github.com/nntaoli-project/goex/okcoin"
"log"
)

Expand All @@ -115,7 +115,7 @@ func main() {

### 更多文档

[GoEx.TOP](https://goex.top)
[goex.TOP](https://goex.top)

### 注意事项

Expand All @@ -137,4 +137,4 @@ ETH:0x98573ddb33cdddce480c3bc1f9279ccd88ca1e93

### 欢迎为作者付一碗面钱

<img src="https://raw.githubusercontent.com/nntaoli-project/GoEx/dev/wx_pay.JPG" width="250" alt="一碗面钱">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/GoEx/dev/IMG_1177.jpg" width="250" alt="一碗面钱">
<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/wx_pay.JPG" width="250" alt="一碗面钱">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/IMG_1177.jpg" width="250" alt="一碗面钱">
28 changes: 14 additions & 14 deletions README_en.md
@@ -1,14 +1,14 @@
<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 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">
</div>

### GoEx
### goex

GoEx project is designed to unify and standardize the interfaces of each digital asset trading platform. The same strategy can be switched to any trading platform at any time without changing any code.
goex project is designed to unify and standardize the interfaces of each digital asset trading platform. The same strategy can be switched to any trading platform at any time without changing any code.

[中文](https://github.com/nntaoli-project/GoEx/blob/dev/README.md)
[中文](https://github.com/nntaoli-project/goex/blob/dev/README.md)

### Exchanges are supported by GoEx `22+`
### Exchanges are supported by goex `22+`
| Exchange | Market API | Order API | Version |
| --- | --- | --- | --- |
| hbg.com | Y | Y | 1 |
Expand All @@ -35,17 +35,17 @@ GoEx project is designed to unify and standardize the interfaces of each digital
| btcchina.com | Y | Y | 1 |
| coinbig.com | Y | Y | * |

### Install GoEx
``` go get github.com/nntaoli-project/GoEx ```
### Install goex
``` go get github.com/nntaoli-project/goex ```

### Example
```golang

package main

import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/GoEx/builder"
"github.com/nntaoli-project/goex"
"github.com/nntaoli-project/goex/builder"
"log"
"time"
)
Expand Down Expand Up @@ -77,9 +77,9 @@ GoEx project is designed to unify and standardize the interfaces of each digital
### websocket Example
```golang
import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/GoEx/huobi"
//"github.com/nntaoli-project/GoEx/okcoin"
"github.com/nntaoli-project/goex"
"github.com/nntaoli-project/goex/huobi"
//"github.com/nntaoli-project/goex/okcoin"
"log"
)

Expand All @@ -105,7 +105,7 @@ func main() {

### More Detail

[GoEx.TOP](https://goex.top)
[goex.TOP](https://goex.top)

# Highly Recommended(IMPORTANCE)
1. use GoLand development.
Expand All @@ -120,4 +120,4 @@ Join QQ group: [574829125](#)

### Buy me a Coffe

<img src="https://raw.githubusercontent.com/nntaoli-project/GoEx/dev/wx_pay.JPG" width="250" alt="Buy me a Coffe">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/GoEx/dev/IMG_1177.jpg" width="250" alt="Buy me a Coffe">
<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/wx_pay.JPG" width="250" alt="Buy me a Coffe">&nbsp;&nbsp;&nbsp;<img src="https://raw.githubusercontent.com/nntaoli-project/goex/dev/IMG_1177.jpg" width="250" alt="Buy me a Coffe">
2 changes: 1 addition & 1 deletion aacoin/aacoin.go
@@ -1,7 +1,7 @@
package aacoin

import (
. "github.com/nntaoli-project/GoEx"
. "github.com/nntaoli-project/goex"
"net/http"
"net/url"

Expand Down
2 changes: 1 addition & 1 deletion aacoin/aacoin_test.go
@@ -1,7 +1,7 @@
package aacoin

import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/goex"
"net/http"
"net/url"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion allcoin/allcoin.go
Expand Up @@ -3,7 +3,7 @@ package allcoin
import (
"encoding/json"
"errors"
. "github.com/nntaoli-project/GoEx"
. "github.com/nntaoli-project/goex"
"log"
"net/http"
"net/url"
Expand Down
2 changes: 1 addition & 1 deletion allcoin/allcoin_test.go
@@ -1,7 +1,7 @@
package allcoin

import (
"github.com/nntaoli-project/GoEx"
"github.com/nntaoli-project/goex"
"net/http"
"testing"
)
Expand Down

0 comments on commit 2da2755

Please sign in to comment.