Skip to content

Commit 3306b8a

Browse files
committed
update READMD.md and add introduction about proxy; replace options with
eoptions, just change the package name
1 parent 5824a29 commit 3306b8a

34 files changed

+58
-39
lines changed

README.md

+22-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ Name | Description | Status
2121
[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
2222
[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
2323
[margin-api.md](https://binance-docs.github.io/apidocs/spot/en) | Details on the Margin API (/sapi) | <input type="checkbox" checked> Implemented
24-
[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
25-
[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
24+
[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | <input type="checkbox" checked> Implemented
25+
[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
26+
[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
27+
28+
29+
Found an unimplemented interface, please submit a issue.
2630

2731
### Installation
2832

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

4145
```golang
4246
import (
47+
// for spot and other interface contained in https://binance-docs.github.io/apidocs/spot/en/#change-log
4348
"github.com/adshao/go-binance/v2"
49+
50+
"github.com/adshao/go-binance/v2/futures" // optional package
51+
"github.com/adshao/go-binance/v2/delivery" // optional package
52+
"github.com/adshao/go-binance/v2/eoptions" // optional package
4453
)
4554
```
4655

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

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

84+
##### Proxy Client
85+
86+
```
87+
proxyUrl := "http://127.0.0.1:7890" // for example, please replace as your exact proxy url.
88+
client := binance.NewProxiedClient(apiKey, apiSecret, proxyUrl)
89+
```
90+
91+
7592
#### Create Order
7693

7794
```golang
@@ -219,8 +236,10 @@ fmt.Println(res)
219236

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

222-
> For delivery API you can use `delivery.WsXxxServe(args, handler, errHandler)`.
239+
> For delivery API you can use `delivery.WsXxxServe(args, handler, errHandler)`.
223240
241+
If you wanna use proxy, you can set `HTTP_PROXY` or `HTTP_PROXY` in environment variable.
242+
224243
#### Depth
225244

226245
```golang

v2/client.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919

2020
"github.com/adshao/go-binance/v2/common"
2121
"github.com/adshao/go-binance/v2/delivery"
22+
"github.com/adshao/go-binance/v2/eoptions"
2223
"github.com/adshao/go-binance/v2/futures"
23-
"github.com/adshao/go-binance/v2/options"
2424
)
2525

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

365-
// NewOptionsClient initialize client for options API
366-
func NewOptionsClient(apiKey, secretKey string) *options.Client {
367-
return options.NewClient(apiKey, secretKey)
365+
// NewOptionsClient initialize client for eoptions API
366+
func NewOptionsClient(apiKey, secretKey string) *eoptions.Client {
367+
return eoptions.NewClient(apiKey, secretKey)
368368
}
369369

370370
type doFunc func(req *http.Request) (*http.Response, error)

v2/options/account_service.go v2/eoptions/account_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/account_service_test.go v2/eoptions/account_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/client.go v2/eoptions/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"bytes"

v2/options/client_test.go v2/eoptions/client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"bytes"

v2/options/depth_service.go v2/eoptions/depth_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/depth_service_test.go v2/eoptions/depth_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/exchange_info_service.go v2/eoptions/exchange_info_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/exchange_info_service_test.go v2/eoptions/exchange_info_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/exercise_history_service.go v2/eoptions/exercise_history_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/exercise_history_service_test.go v2/eoptions/exercise_history_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/index_service.go v2/eoptions/index_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/index_service_test.go v2/eoptions/index_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/kline_service.go v2/eoptions/kline_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/kline_service_test.go v2/eoptions/kline_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/mark_service.go v2/eoptions/mark_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/mark_service_test.go v2/eoptions/mark_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/open_interest_service.go v2/eoptions/open_interest_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/open_interest_service_test.go v2/eoptions/open_interest_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/order_service.go v2/eoptions/order_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/order_service_test.go v2/eoptions/order_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"encoding/json"

v2/options/request.go v2/eoptions/request.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"fmt"

v2/options/server_service.go v2/eoptions/server_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/server_service_test.go v2/eoptions/server_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/ticker_service.go v2/eoptions/ticker_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/ticker_service_test.go v2/eoptions/ticker_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/trade_service_test.go v2/eoptions/trade_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/trades_service.go v2/eoptions/trades_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/user_stream_service.go v2/eoptions/user_stream_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"context"

v2/options/user_stream_service_test.go v2/eoptions/user_stream_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"testing"

v2/options/websocket.go v2/eoptions/websocket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"net/http"

v2/options/websocket_service.go v2/eoptions/websocket_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"encoding/json"

v2/options/websocket_service_test.go v2/eoptions/websocket_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package options
1+
package eoptions
22

33
import (
44
"errors"

0 commit comments

Comments
 (0)