-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitget.go
More file actions
35 lines (31 loc) · 1.19 KB
/
Copy pathbitget.go
File metadata and controls
35 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package bitget
import (
"github.com/tigusigalpa/bitget-go/rest/account"
"github.com/tigusigalpa/bitget-go/rest/market"
"github.com/tigusigalpa/bitget-go/rest/trade"
)
// RestClient is the main entry point for the REST API, grouping every
// service under one struct. Construct it with NewRestClient.
type RestClient struct {
*Client
// Market provides public, unauthenticated market-data endpoints.
Market *market.Client
// Account provides private account/balance/leverage endpoints.
Account *account.Client
// Trade provides private order-placement and position endpoints.
Trade *trade.Client
}
// NewRestClient creates a fully wired Bitget UTA v3 REST client. apiKey,
// secretKey, and passphrase come from the API key created in the Bitget
// web console; see https://www.bitget.com/api-doc/uta/guide.
//
// Public endpoints (RestClient.Market) work even with empty credentials.
func NewRestClient(apiKey, secretKey, passphrase string, opts ...Option) *RestClient {
client := NewClient(apiKey, secretKey, passphrase, opts...)
return &RestClient{
Client: client,
Market: market.NewClient(client.doPublic),
Account: account.NewClient(client.do),
Trade: trade.NewClient(client.do),
}
}