Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bitgetlimited
GitHub Repository: bitgetlimited/v3-bitget-api-sdk
Path: blob/master/bitget-golang-sdk-api/pkg/client/v1/spotmarketclient.go
518 views
1
package v1
2
3
import (
4
"bitget/internal"
5
"bitget/internal/common"
6
)
7
8
type SpotMarketClient struct {
9
BitgetRestClient *common.BitgetRestClient
10
}
11
12
func (p *SpotMarketClient) Init() *SpotMarketClient {
13
p.BitgetRestClient = new(common.BitgetRestClient).Init()
14
return p
15
}
16
17
func (p *SpotMarketClient) Currencies() (string, error) {
18
params := internal.NewParams()
19
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/public/currencies", params)
20
return resp, err
21
}
22
23
func (p *SpotMarketClient) Products(params map[string]string) (string, error) {
24
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/public/products", params)
25
return resp, err
26
}
27
28
func (p *SpotMarketClient) Product(params map[string]string) (string, error) {
29
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/public/product", params)
30
return resp, err
31
}
32
33
func (p *SpotMarketClient) Fills(params map[string]string) (string, error) {
34
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/market/fills", params)
35
return resp, err
36
}
37
38
func (p *SpotMarketClient) Depth(params map[string]string) (string, error) {
39
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/market/depth", params)
40
return resp, err
41
}
42
43
func (p *SpotMarketClient) Tickers(params map[string]string) (string, error) {
44
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/market/tickers", params)
45
return resp, err
46
}
47
48
func (p *SpotMarketClient) Ticker(params map[string]string) (string, error) {
49
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/market/ticker", params)
50
return resp, err
51
}
52
53
func (p *SpotMarketClient) Candles(params map[string]string) (string, error) {
54
resp, err := p.BitgetRestClient.DoGet("/api/spot/v1/market/candles", params)
55
return resp, err
56
}
57
58