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/spotwalletclient.go
518 views
1
package v1
2
3
import (
4
"bitget/internal"
5
"bitget/internal/common"
6
)
7
8
type SpotWalletApi struct {
9
BitgetRestClient *common.BitgetRestClient
10
}
11
12
func (p *SpotWalletApi) Transfer(params map[string]string) (string, error) {
13
postBody, jsonErr := internal.ToJson(params)
14
if jsonErr != nil {
15
return "", jsonErr
16
}
17
resp, err := p.BitgetRestClient.DoPost("/api/v2/spot/wallet/transfer", postBody)
18
return resp, err
19
}
20
21
func (p *SpotWalletApi) DepositAddress(params map[string]string) (string, error) {
22
resp, err := p.BitgetRestClient.DoGet("/api/v2/spot/wallet/deposit-address", params)
23
return resp, err
24
}
25
26
func (p *SpotWalletApi) Withdrawal(params map[string]string) (string, error) {
27
postBody, jsonErr := internal.ToJson(params)
28
if jsonErr != nil {
29
return "", jsonErr
30
}
31
resp, err := p.BitgetRestClient.DoPost("/api/v2/spot/wallet/withdrawal", postBody)
32
return resp, err
33
}
34
35
func (p *SpotWalletApi) WithdrawalRecords(params map[string]string) (string, error) {
36
resp, err := p.BitgetRestClient.DoGet("/api/v2/spot/wallet/withdrawal-records", params)
37
return resp, err
38
}
39
40
func (p *SpotWalletApi) DepositRecords(params map[string]string) (string, error) {
41
resp, err := p.BitgetRestClient.DoGet("/api/v2/spot/wallet/deposit-records", params)
42
return resp, err
43
}
44
45