Skip to content

Commit

Permalink
Release v0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alplabin committed Nov 20, 2024
1 parent 334330f commit e41c66f
Show file tree
Hide file tree
Showing 25 changed files with 2,503 additions and 485 deletions.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,45 @@

## v0.8.0 - 2024-11-20

### Added
- Added `Wallet` Endpoints:
- `GET /sapi/v1/account/info` - Fetch account info detail
- `GET /sapi/v1/asset/custody/transfer-history` - Query user delegation history
- `GET /sapi/v1/asset/wallet/balance` - Query user wallet balance
- `GET /sapi/v1/capital/deposit/address/list` - Fetch deposit address list with network
- `GET /sapi/v1/spot/delist-schedule` - Query spot delist schedule

- Added `Margin` Endpoints:
- `GET /sapi/v1/margin/available-inventory`
- `GET /sapi/v1/margin/capital-flow`
- `GET /sapi/v1/margin/leverageBracket`
- `POST /sapi/v1/margin/manual-liquidation`
- `POST /sapi/v1/margin/max-leverage`
- `POST /sapi/v1/margin/order/oto`
- `POST /sapi/v1/margin/order/otoco`

### Fixed
- Fixed `TestConnectivityResponse.RateLimits` type - updated to array
- Fixed `NewTickerPriceService.Do` unmarshaling issue
- Fixed `SystemStatusResponse` type
- Fixed variable named `CumulativeQuoteQty` to `CummulativeQuoteQty`
- Fixed `SubAccountTransferHistoryService` response type
- Fixed field `Fills` type in `CancelReplaceResponse`

### Updated
- Added the parameters `symbol`, `symbols`, `permissions` , `showPermissionSets` and `symbolStatus` to endpoint `GET /api/v3/exchangeInfo`
- Added parameter `accountType` to endpoint `POST /sapi/v1/asset/dust-btc`
- Added response fields `Created`, `CollateralMarginLevel`, `TotalCollateralValueInUSDT`, `TransferInEnabled`, `TransferOutEnabled` and `AccountType` to endpoint `GET /sapi/v1/margin/account`
- Added response fields `EnableFixApiTrade`, `EnableFixReadOnly` and `EnablePortfolioMarginTrading` to endpoint `GET /sapi/v1/account/apiRestrictions`
- Updated `SymbolInfo` and `SymbolFilter` types
- Removed response field `resetAddressStatus` and added fields `contractAddressUrl` and `contractAddress` from endpoint `GET /sapi/v1/capital/config/getall`


### Removed
- Removed `Wallet` endpoints:
- `GET /sapi/v1/capital/contract/convertible-coins`
- `POST /sapi/v1/asset/convert-transfer`

## v0.7.0 - 2024-08-23

### Added
Expand Down
58 changes: 32 additions & 26 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ type CreateOrderResponseRESULT struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cummulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand All @@ -423,7 +423,7 @@ type CreateOrderResponseFULL struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cummulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand Down Expand Up @@ -569,7 +569,7 @@ type CancelOrderResponse struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand Down Expand Up @@ -651,7 +651,7 @@ type GetOrderResponse struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand Down Expand Up @@ -904,31 +904,37 @@ type CancelReplaceResponse struct {
Price string `json:"price,omitempty"`
OrigQty string `json:"origQty,omitempty"`
ExecutedQty string `json:"executedQty,omitempty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty,omitempty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty,omitempty"`
Status string `json:"status,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
Type string `json:"type,omitempty"`
Side string `json:"side,omitempty"`
SelfTradePreventionMode string `json:"selfTradePreventionMode,omitempty"`
} `json:"cancelResponse,omitempty"`
NewOrderResponse *struct {
Code int64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Symbol string `json:"symbol,omitempty"`
OrderId int64 `json:"orderId,omitempty"`
OrderListId int64 `json:"orderListId,omitempty"`
ClientOrderId string `json:"clientOrderId,omitempty"`
TransactTime uint64 `json:"transactTime,omitempty"`
Price string `json:"price,omitempty"`
OrigQty string `json:"origQty,omitempty"`
ExecutedQty string `json:"executedQty,omitempty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty,omitempty"`
Status string `json:"status,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
Type string `json:"type,omitempty"`
Side string `json:"side,omitempty"`
Fills []string `json:"fills,omitempty"`
SelfTradePreventionMode string `json:"selfTradePreventionMode,omitempty"`
Code int64 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
Symbol string `json:"symbol,omitempty"`
OrderId int64 `json:"orderId,omitempty"`
OrderListId int64 `json:"orderListId,omitempty"`
ClientOrderId string `json:"clientOrderId,omitempty"`
TransactTime uint64 `json:"transactTime,omitempty"`
Price string `json:"price,omitempty"`
OrigQty string `json:"origQty,omitempty"`
ExecutedQty string `json:"executedQty,omitempty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty,omitempty"`
Status string `json:"status,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
Type string `json:"type,omitempty"`
Side string `json:"side,omitempty"`
Fills []struct {
Price string `json:"price"`
Qty string `json:"qty"`
Commission string `json:"commission"`
CommissionAsset string `json:"commissionAsset"`
TradeId int64 `json:"tradeId"`
} `json:"fills,omitempty"`
SelfTradePreventionMode string `json:"selfTradePreventionMode,omitempty"`
} `json:"newOrderResponse,omitempty"`
Data *struct {
CancelResult string `json:"cancelResult,omitempty"`
Expand All @@ -944,7 +950,7 @@ type CancelReplaceResponse struct {
Price string `json:"price,omitempty"`
OrigQty string `json:"origQty,omitempty"`
ExecutedQty string `json:"executedQty,omitempty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty,omitempty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty,omitempty"`
Status string `json:"status,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
Type string `json:"type,omitempty"`
Expand All @@ -962,7 +968,7 @@ type CancelReplaceResponse struct {
Price string `json:"price,omitempty"`
OrigQty string `json:"origQty,omitempty"`
ExecutedQty string `json:"executedQty,omitempty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty,omitempty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty,omitempty"`
Status string `json:"status,omitempty"`
TimeInForce string `json:"timeInForce,omitempty"`
Type string `json:"type,omitempty"`
Expand Down Expand Up @@ -1017,7 +1023,7 @@ type NewOpenOrdersResponse struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand Down Expand Up @@ -1124,7 +1130,7 @@ type NewAllOrdersResponse struct {
Price string `json:"price"`
OrigQty string `json:"origQty"`
ExecutedQty string `json:"executedQty"`
CumulativeQuoteQty string `json:"cumulativeQuoteQty"`
CummulativeQuoteQty string `json:"cummulativeQuoteQty"`
Status string `json:"status"`
TimeInForce string `json:"timeInForce"`
Type string `json:"type"`
Expand Down
60 changes: 30 additions & 30 deletions account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (s *accountTestSuite) TestNewOrder() {
Price: "0.00000000",
OrigQty: "10.00000000",
ExecutedQty: "10.00000000",
CumulativeQuoteQty: "10.00000000",
CummulativeQuoteQty: "10.00000000",
Status: "FILLED",
TimeInForce: "GTC",
Type: "MARKET",
Expand All @@ -259,7 +259,7 @@ func (s *baseTestSuite) assertCreateOrderResponseEqual(e, a *CreateOrderResponse
r.Equal(e.Price, a.Price, "Price")
r.Equal(e.OrigQty, a.OrigQty, "OrigQty")
r.Equal(e.ExecutedQty, a.ExecutedQty, "ExecutedQty")
r.Equal(e.CumulativeQuoteQty, a.CumulativeQuoteQty, "CumulativeQuoteQty")
r.Equal(e.CummulativeQuoteQty, a.CummulativeQuoteQty, "CummulativeQuoteQty")
r.Equal(e.Status, a.Status, "Status")
r.Equal(e.TimeInForce, a.TimeInForce, "TimeInForce")
r.Equal(e.Type, a.Type, "Type")
Expand All @@ -278,7 +278,7 @@ func (s *accountTestSuite) TestCancelOrder() {
"price": "0.001",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cumulativeQuoteQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
Expand Down Expand Up @@ -309,7 +309,7 @@ func (s *accountTestSuite) TestCancelOrder() {
Price: "0.001",
OrigQty: "1.00000000",
ExecutedQty: "0.00000000",
CumulativeQuoteQty: "0.00000000",
CummulativeQuoteQty: "0.00000000",
Status: "CANCELED",
TimeInForce: "GTC",
Type: "LIMIT",
Expand All @@ -329,7 +329,7 @@ func (s *accountTestSuite) assertCancelOrderEqual(e, a *CancelOrderResponse) {
r.Equal(e.Price, a.Price, "Price")
r.Equal(e.OrigQty, a.OrigQty, "OrigQty")
r.Equal(e.ExecutedQty, a.ExecutedQty, "ExecutedQty")
r.Equal(e.CumulativeQuoteQty, a.CumulativeQuoteQty, "CumulativeQuoteQty")
r.Equal(e.CummulativeQuoteQty, a.CummulativeQuoteQty, "CummulativeQuoteQty")
r.Equal(e.Status, a.Status, "Status")
r.Equal(e.TimeInForce, a.TimeInForce, "TimeInForce")
r.Equal(e.Type, a.Type, "Type")
Expand Down Expand Up @@ -398,7 +398,7 @@ func (s *accountTestSuite) TestGetOrder() {
"price": "100.00",
"origQty": "10.00",
"executedQty": "0.00",
"cumulativeQuoteQty": "0.00",
"cummulativeQuoteQty": "0.00",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
Expand All @@ -418,24 +418,24 @@ func (s *accountTestSuite) TestGetOrder() {
s.r().NoError(err)

s.assertGetOrderResponseEqual(&GetOrderResponse{
Symbol: "BTCUSDT",
OrderId: 12345,
OrderListId: -1,
ClientOrderId: "abcde12345",
Price: "100.00",
OrigQty: "10.00",
ExecutedQty: "0.00",
CumulativeQuoteQty: "0.00",
Status: "NEW",
TimeInForce: "GTC",
Type: "LIMIT",
Side: "BUY",
StopPrice: "0.00",
IcebergQty: "0.00",
Time: 1499827319559,
UpdateTime: 1499827319559,
IsWorking: true,
OrigQuoteOrderQty: "0.000000",
Symbol: "BTCUSDT",
OrderId: 12345,
OrderListId: -1,
ClientOrderId: "abcde12345",
Price: "100.00",
OrigQty: "10.00",
ExecutedQty: "0.00",
CummulativeQuoteQty: "0.00",
Status: "NEW",
TimeInForce: "GTC",
Type: "LIMIT",
Side: "BUY",
StopPrice: "0.00",
IcebergQty: "0.00",
Time: 1499827319559,
UpdateTime: 1499827319559,
IsWorking: true,
OrigQuoteOrderQty: "0.000000",
}, res)
}

Expand Down Expand Up @@ -658,7 +658,7 @@ func (s *accountTestSuite) TestGetAllOrders() {
"price": "25000.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cumulativeQuoteQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
Expand Down Expand Up @@ -697,7 +697,7 @@ func (s *accountTestSuite) TestGetAllOrders() {
s.Equal("25000.00000000", resp[0].Price)
s.Equal("1.00000000", resp[0].OrigQty)
s.Equal("0.00000000", resp[0].ExecutedQty)
s.Equal("0.00000000", resp[0].CumulativeQuoteQty)
s.Equal("0.00000000", resp[0].CummulativeQuoteQty)
s.Equal("NEW", resp[0].Status)
s.Equal("GTC", resp[0].TimeInForce)
s.Equal("LIMIT", resp[0].Type)
Expand Down Expand Up @@ -725,7 +725,7 @@ func (s *accountTestSuite) TestCancelOpenOrders() {
"price": "0.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cumulativeQuoteQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
Expand All @@ -741,7 +741,7 @@ func (s *accountTestSuite) TestCancelOpenOrders() {
"price": "0.00000000",
"origQty": "2.00000000",
"executedQty": "0.00000000",
"cumulativeQuoteQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
Expand All @@ -767,7 +767,7 @@ func (s *accountTestSuite) TestCancelOpenOrders() {
s.Equal("0.00000000", res[0].Price)
s.Equal("1.00000000", res[0].OrigQty)
s.Equal("0.00000000", res[0].ExecutedQty)
s.Equal("0.00000000", res[0].CumulativeQuoteQty)
s.Equal("0.00000000", res[0].CummulativeQuoteQty)
s.Equal("CANCELED", res[0].Status)
s.Equal("GTC", res[0].TimeInForce)
s.Equal("LIMIT", res[0].Type)
Expand All @@ -782,7 +782,7 @@ func (s *accountTestSuite) TestCancelOpenOrders() {
s.Equal("0.00000000", res[1].Price)
s.Equal("2.00000000", res[1].OrigQty)
s.Equal("0.00000000", res[1].ExecutedQty)
s.Equal("0.00000000", res[1].CumulativeQuoteQty)
s.Equal("0.00000000", res[1].CummulativeQuoteQty)
s.Equal("CANCELED", res[1].Status)
s.Equal("GTC", res[1].TimeInForce)
s.Equal("LIMIT", res[1].Type)
Expand Down
Loading

0 comments on commit e41c66f

Please sign in to comment.