mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-13 02:23:51 +00:00
Merge pull request #172 from c9s/feature/max-vip-level-fee
feature: support max vip level query api
This commit is contained in:
commit
6cf5e06d68
|
@ -34,6 +34,7 @@ type UserInfo struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Type string `json:"member_type"`
|
Type string `json:"member_type"`
|
||||||
Level int `json:"level"`
|
Level int `json:"level"`
|
||||||
|
VipLevel int `json:"vip_level"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
Accounts []Account `json:"accounts"`
|
Accounts []Account `json:"accounts"`
|
||||||
Bank *UserBank `json:"bank,omitempty"`
|
Bank *UserBank `json:"bank,omitempty"`
|
||||||
|
@ -50,6 +51,39 @@ type UserInfo struct {
|
||||||
ReferralCode string `json:"referral_code"`
|
ReferralCode string `json:"referral_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type VipLevelSettings struct {
|
||||||
|
Level int `json:"level"`
|
||||||
|
MinimumTradingVolume float64 `json:"minimum_trading_volume"`
|
||||||
|
MinimumStakingVolume float64 `json:"minimum_staking_volume"`
|
||||||
|
MakerFee float64 `json:"maker_fee"`
|
||||||
|
TakerFee float64 `json:"taker_fee"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type VipLevel struct {
|
||||||
|
Current VipLevelSettings `json:"current_vip_level"`
|
||||||
|
Next VipLevelSettings `json:"next_vip_level"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *AccountService) VipLevel() (*VipLevel, error) {
|
||||||
|
req, err := s.client.newAuthenticatedRequest("GET", "v2/members/vip_level", nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
response, err := s.client.sendRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var vipLevel VipLevel
|
||||||
|
err = response.DecodeJSON(&vipLevel)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &vipLevel, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *AccountService) Account(currency string) (*Account, error) {
|
func (s *AccountService) Account(currency string) (*Account, error) {
|
||||||
req, err := s.client.newAuthenticatedRequest("GET", "v2/members/accounts/"+currency, nil)
|
req, err := s.client.newAuthenticatedRequest("GET", "v2/members/accounts/"+currency, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user