|
| 1 | +package binance |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + "net/http" |
| 6 | +) |
| 7 | + |
| 8 | +type GetDelistService struct { |
| 9 | + c *Client |
| 10 | +} |
| 11 | + |
| 12 | +// Weight: 50 |
| 13 | +func (s *GetDelistService) Do(ctx context.Context, opts ...RequestOption) ([]*DelistBatch, error) { |
| 14 | + r := &request{ |
| 15 | + method: http.MethodGet, |
| 16 | + endpoint: "/sapi/v1/spot/delist-schedule", |
| 17 | + secType: secTypeSigned, |
| 18 | + } |
| 19 | + data, err := s.c.callAPI(ctx, r, opts...) |
| 20 | + if err != nil { |
| 21 | + return nil, err |
| 22 | + } |
| 23 | + |
| 24 | + var res []*DelistBatch |
| 25 | + err = json.Unmarshal(data, &res) |
| 26 | + if err != nil { |
| 27 | + return nil, err |
| 28 | + } |
| 29 | + return res, nil |
| 30 | +} |
| 31 | + |
| 32 | +type MarginGetDelistService struct { |
| 33 | + c *Client |
| 34 | +} |
| 35 | + |
| 36 | +type DelistBatch struct { |
| 37 | + DelistTime int64 `json:"delistTime"` |
| 38 | + Symbols []string `json:"symbols"` |
| 39 | +} |
| 40 | + |
| 41 | +// Weight: 100 |
| 42 | +func (s *MarginGetDelistService) Do(ctx context.Context, opts ...RequestOption) ([]*MarginDelistBatch, error) { |
| 43 | + r := &request{ |
| 44 | + method: http.MethodGet, |
| 45 | + endpoint: "/sapi/v1/margin/delist-schedule", |
| 46 | + secType: secTypeSigned, |
| 47 | + } |
| 48 | + data, err := s.c.callAPI(ctx, r, opts...) |
| 49 | + if err != nil { |
| 50 | + return nil, err |
| 51 | + } |
| 52 | + |
| 53 | + var res []*MarginDelistBatch |
| 54 | + err = json.Unmarshal(data, &res) |
| 55 | + if err != nil { |
| 56 | + return nil, err |
| 57 | + } |
| 58 | + return res, nil |
| 59 | +} |
| 60 | + |
| 61 | +type MarginDelistBatch struct { |
| 62 | + DelistTime int64 `json:"delistTime"` |
| 63 | + CrossMarginAssets []string `json:"crossMarginAssets"` |
| 64 | + IsolatedMarginSymbols []string `json:"isolatedMarginSymbols"` |
| 65 | +} |
0 commit comments