Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update README.md, add introduction about options and proxy #569

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ Name | Description | Status
[web-socket-streams.md](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md) | Details on available streams and payloads | <input type="checkbox" checked> Implemented
[user-data-stream.md](https://github.com/binance/binance-spot-api-docs/blob/master/user-data-stream.md) | Details on the dedicated account stream | <input type="checkbox" checked> Implemented
[margin-api.md](https://binance-docs.github.io/apidocs/spot/en) | Details on the Margin API (/sapi) | <input type="checkbox" checked> Implemented
[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | <input type="checkbox" checked> Partially Implemented
[delivery-api.md](https://binance-docs.github.io/apidocs/delivery/en/#general-info) | Details on the Coin-M Futures API (/dapi) | <input type="checkbox" checked> Partially Implemented
[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | <input type="checkbox" checked> Implemented
[delivery-api.md](https://binance-docs.github.io/apidocs/delivery/en/#general-info) | Details on the Coin-M Futures API (/dapi) | <input type="checkbox" checked> Implemented
[eoptions-api.md](https://binance-docs.github.io/apidocs/voptions/en/#general-info) | Detains on the European Options API(/eapi) | <input type="checkbox" checked> Implemented


Found an unimplemented interface, please submit a issue.

### Installation

Expand All @@ -40,7 +44,12 @@ go get github.com/adshao/go-binance/v1

```golang
import (
// for spot and other interface contained in https://binance-docs.github.io/apidocs/spot/en/#change-log
"github.com/adshao/go-binance/v2"

"github.com/adshao/go-binance/v2/futures" // optional package
"github.com/adshao/go-binance/v2/delivery" // optional package
"github.com/adshao/go-binance/v2/eoptions" // optional package
)
```

Expand Down Expand Up @@ -72,6 +81,14 @@ Following are some simple examples, please refer to [godoc](https://godoc.org/gi

If you have any questions, please refer to the specific version of the code for specific reference definitions or usage methods

##### Proxy Client

```
proxyUrl := "http://127.0.0.1:7890" // for example, please replace as your exact proxy url.
client := binance.NewProxiedClient(apiKey, apiSecret, proxyUrl)
```


#### Create Order

```golang
Expand Down Expand Up @@ -219,8 +236,10 @@ fmt.Println(res)

You don't need Client in websocket API. Just call binance.WsXxxServe(args, handler, errHandler).

> For delivery API you can use `delivery.WsXxxServe(args, handler, errHandler)`.
> For delivery API you can use `delivery.WsXxxServe(args, handler, errHandler)`.

If you wanna use proxy, you can set `HTTP_PROXY` or `HTTP_PROXY` in environment variable.

#### Depth

```golang
Expand Down
8 changes: 4 additions & 4 deletions v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (

"github.com/adshao/go-binance/v2/common"
"github.com/adshao/go-binance/v2/delivery"
"github.com/adshao/go-binance/v2/eoptions"
"github.com/adshao/go-binance/v2/futures"
"github.com/adshao/go-binance/v2/options"
)

// SideType define side type of order
Expand Down Expand Up @@ -362,9 +362,9 @@ func NewDeliveryClient(apiKey, secretKey string) *delivery.Client {
return delivery.NewClient(apiKey, secretKey)
}

// NewOptionsClient initialize client for options API
func NewOptionsClient(apiKey, secretKey string) *options.Client {
return options.NewClient(apiKey, secretKey)
// NewOptionsClient initialize client for eoptions API
func NewOptionsClient(apiKey, secretKey string) *eoptions.Client {
return eoptions.NewClient(apiKey, secretKey)
}

type doFunc func(req *http.Request) (*http.Response, error)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion v2/options/client.go → v2/eoptions/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion v2/options/client_test.go → v2/eoptions/client_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion v2/options/mark_service.go → v2/eoptions/mark_service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"encoding/json"
Expand Down
2 changes: 1 addition & 1 deletion v2/options/request.go → v2/eoptions/request.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion v2/options/websocket.go → v2/eoptions/websocket.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"net/http"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"encoding/json"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package options
package eoptions

import (
"errors"
Expand Down
Loading