Skip to content

Commit

Permalink
fix current existly typos (adshao#582)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyq-c-cpp authored Jun 26, 2024
1 parent b3a9097 commit a387a5b
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 24 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ on:
workflow_dispatch:

jobs:
TyposCheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
with:
config: ./typos.toml

UnitTest:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Name | Description | Status
[margin-api.md](https://binance-docs.github.io/apidocs/spot/en) | Details on the Margin API (/sapi) | <input type="checkbox" checked> Implemented
[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | <input type="checkbox" checked> Implemented
[delivery-api.md](https://binance-docs.github.io/apidocs/delivery/en/#general-info) | Details on the Coin-M Futures API (/dapi) | <input type="checkbox" checked> Implemented
[options-api.md](https://binance-docs.github.io/apidocs/voptions/en/#general-info) | Detains on the Options API(/eapi) | <input type="checkbox" checked> Implemented
[options-api.md](https://binance-docs.github.io/apidocs/voptions/en/#general-info) | Details on the Options API(/eapi) | <input type="checkbox" checked> Implemented


If you find an unimplemented interface, please submit an issue.
If you find an unimplemented interface, please submit an issue. It's great if you can open a PR to fix it.

### Installation

Expand Down
27 changes: 27 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[files]
ignore-files = true
ignore-hidden = false
extend-exclude = [
".git/",
"v2/go.mod",
"v2/go.sum",
"v2/go.work.sum",
]


[default]
extend-ignore-re=[
"ios_54d9b18d8e7a4caf9d149573e16480ba",
"Pn",
"SIZ9",
"alo",
"ot",
"[Cc]ummulative",
"OTU",
"[Tt]ransfered",
]
check-filename = true




6 changes: 3 additions & 3 deletions v2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
}
defer func() {
cerr := res.Body.Close()
// Only overwrite the retured error if the original error was nil and an
// Only overwrite the returned error if the original error was nil and an
// error occurred while closing the body.
if err == nil && cerr != nil {
err = cerr
Expand Down Expand Up @@ -1008,7 +1008,7 @@ func (c *Client) NewGetAllLiquidityPoolService() *GetAllLiquidityPoolService {
return &GetAllLiquidityPoolService{c: c}
}

// NewGetLiquidityPoolDetailService init the get liquidity pool detial service
// NewGetLiquidityPoolDetailService init the get liquidity pool detail service
func (c *Client) NewGetLiquidityPoolDetailService() *GetLiquidityPoolDetailService {
return &GetLiquidityPoolDetailService{c: c}
}
Expand Down Expand Up @@ -1043,7 +1043,7 @@ func (c *Client) NewClaimRewardService() *ClaimRewardService {
return &ClaimRewardService{c: c}
}

// NewRemoveLiquidityService init the service to remvoe liquidity
// NewRemoveLiquidityService init the service to remove liquidity
func (c *Client) NewRemoveLiquidityService() *RemoveLiquidityService {
return &RemoveLiquidityService{c: c, assets: []string{}}
}
Expand Down
2 changes: 1 addition & 1 deletion v2/delivery/account_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type AccountAsset struct {
AvailableBalance string `json:"availableBalance"`
}

// AccountPosition define accoutn position
// AccountPosition define account position
type AccountPosition struct {
Symbol string `json:"symbol"`
PositionAmt string `json:"positionAmt"`
Expand Down
2 changes: 1 addition & 1 deletion v2/delivery/account_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func (s *accountServiceTestSuite) assertAccountEqual(e, a *Account) {
r.Equal(e.Assets[i].MarginBalance, a.Assets[i].MarginBalance, "MarginBalance")
r.Equal(e.Assets[i].MaxWithdrawAmount, a.Assets[i].MaxWithdrawAmount, "MaxWithdrawAmount")
r.Equal(e.Assets[i].OpenOrderInitialMargin, a.Assets[i].OpenOrderInitialMargin, "OpenOrderInitialMargin")
r.Equal(e.Assets[i].PositionInitialMargin, e.Assets[i].PositionInitialMargin, "PossitionInitialMargin")
r.Equal(e.Assets[i].PositionInitialMargin, e.Assets[i].PositionInitialMargin, "PositionInitialMargin")
r.Equal(e.Assets[i].UnrealizedProfit, a.Assets[i].UnrealizedProfit, "UnrealizedProfit")
r.Equal(e.Assets[i].WalletBalance, a.Assets[i].WalletBalance, "WalletBalance")
}
Expand Down
2 changes: 1 addition & 1 deletion v2/delivery/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
}
defer func() {
cerr := res.Body.Close()
// Only overwrite the retured error if the original error was nil and an
// Only overwrite the returned error if the original error was nil and an
// error occurred while closing the body.
if err == nil && cerr != nil {
err = cerr
Expand Down
4 changes: 2 additions & 2 deletions v2/dust_log_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ type DustResult struct {
// UserAssetDribblet represents one dust log row
type UserAssetDribblet struct {
OperateTime int64 `json:"operateTime"`
TotalTransferedAmount string `json:"totalTransferedAmount"` //Total transfered BNB amount for this exchange.
TotalTransferedAmount string `json:"totalTransferedAmount"` //Total transferred BNB amount for this exchange.
TotalServiceChargeAmount string `json:"totalServiceChargeAmount"` //Total service charge amount for this exchange.
TransID int64 `json:"transId"`
UserAssetDribbletDetails []UserAssetDribbletDetail `json:"userAssetDribbletDetails"` //Details of this exchange.
}

// DustLog represents one dust log informations
// DustLog represents one dust log information
type UserAssetDribbletDetail struct {
TransID int `json:"transId"`
ServiceChargeAmount string `json:"serviceChargeAmount"`
Expand Down
2 changes: 1 addition & 1 deletion v2/futures/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
}
defer func() {
cerr := res.Body.Close()
// Only overwrite the retured error if the original error was nil and an
// Only overwrite the returned error if the original error was nil and an
// error occurred while closing the body.
if err == nil && cerr != nil {
err = cerr
Expand Down
8 changes: 4 additions & 4 deletions v2/futures/websocket_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ type WsContinuousKline struct {
ActiveBuyQuoteVolume string `json:"Q"`
}

// WsContinuousKlineSubcribeArgs used with WsContinuousKlineServe or WsCombinedContinuousKlineServe
type WsContinuousKlineSubcribeArgs struct {
// WsContinuousKlineSubscribeArgs used with WsContinuousKlineServe or WsCombinedContinuousKlineServe
type WsContinuousKlineSubscribeArgs struct {
Pair string
ContractType string
Interval string
Expand All @@ -392,7 +392,7 @@ type WsContinuousKlineSubcribeArgs struct {
type WsContinuousKlineHandler func(event *WsContinuousKlineEvent)

// WsContinuousKlineServe serve websocket continuous kline handler with a pair and contractType and interval like 15m, 30s
func WsContinuousKlineServe(subscribeArgs *WsContinuousKlineSubcribeArgs, handler WsContinuousKlineHandler,
func WsContinuousKlineServe(subscribeArgs *WsContinuousKlineSubscribeArgs, handler WsContinuousKlineHandler,
errHandler ErrHandler) (doneC, stopC chan struct{}, err error) {
endpoint := fmt.Sprintf("%s/%s_%s@continuousKline_%s", getWsEndpoint(), strings.ToLower(subscribeArgs.Pair),
strings.ToLower(subscribeArgs.ContractType), subscribeArgs.Interval)
Expand All @@ -410,7 +410,7 @@ func WsContinuousKlineServe(subscribeArgs *WsContinuousKlineSubcribeArgs, handle
}

// WsCombinedContinuousKlineServe is similar to WsContinuousKlineServe, but it handles multiple pairs of different contractType with its interval
func WsCombinedContinuousKlineServe(subscribeArgsList []*WsContinuousKlineSubcribeArgs,
func WsCombinedContinuousKlineServe(subscribeArgsList []*WsContinuousKlineSubscribeArgs,
handler WsContinuousKlineHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) {
endpoint := getCombinedEndpoint()
for _, val := range subscribeArgsList {
Expand Down
4 changes: 2 additions & 2 deletions v2/futures/websocket_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func (s *websocketServiceTestSuite) TestContinuousKlineServe() {
s.mockWsServe(data, errors.New(fakeErrMsg))
defer s.assertWsServe()

doneC, stopC, err := WsContinuousKlineServe(&WsContinuousKlineSubcribeArgs{
doneC, stopC, err := WsContinuousKlineServe(&WsContinuousKlineSubscribeArgs{
Pair: "BTCUSDT",
ContractType: "PERPETUAL",
Interval: "1m",
Expand Down Expand Up @@ -668,7 +668,7 @@ func (s *websocketServiceTestSuite) TestWsCombinedContinuousKlineServe() {
s.mockWsServe(data, errors.New(fakeErrMsg))
defer s.assertWsServe()

input := []*WsContinuousKlineSubcribeArgs{
input := []*WsContinuousKlineSubscribeArgs{
{
Pair: "ETHBTC",
ContractType: "PERPETUAL",
Expand Down
4 changes: 2 additions & 2 deletions v2/liquidity_pool_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ func (s *GetUserSwapRecordsService) SwapId(swapId int64) *GetUserSwapRecordsServ
return s
}

// StartTime set start time when swaping
// StartTime set start time when swapping
func (s *GetUserSwapRecordsService) StartTime(startTime int64) *GetUserSwapRecordsService {
s.startTime = &startTime
return s
}

// EndTime set end time when swaping
// EndTime set end time when swapping
func (s *GetUserSwapRecordsService) EndTime(endTime int64) *GetUserSwapRecordsService {
s.endTime = &endTime
return s
Expand Down
2 changes: 1 addition & 1 deletion v2/options/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
}
defer func() {
cerr := res.Body.Close()
// Only overwrite the retured error if the original error was nil and an
// Only overwrite the returned error if the original error was nil and an
// error occurred while closing the body.
if err == nil && cerr != nil {
err = cerr
Expand Down
4 changes: 2 additions & 2 deletions v2/options/order_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ type Order struct {
CreateTime int64 `json:"createTime"`
UpdateTime int64 `json:"updateTime"`
Status OrderStatusType `json:"status"`
Reason *string `json:"reason"` // setted while query histroy orders.
Reason *string `json:"reason"` // set while query history orders.
AvgPrice string `json:"avgPrice"`
Source string `json:"source"`
ClientOrderId string `json:"clientOrderId"`
Expand All @@ -188,7 +188,7 @@ type Order struct {
OptionSide OptionSideType `json:"optionSide"`
QuoteAsset string `json:"quoteAsset"`
Mmp bool `json:"mmp"`
LastTrade *LastTrade `json:"lastTrade"` // order is immediately filled while calling create order, it will be setted.
LastTrade *LastTrade `json:"lastTrade"` // order is immediately filled while calling create order, it will be set.

RateLimitOrder10s string `json:"rateLimitOrder10s,omitempty"`
RateLimitOrder1m string `json:"rateLimitOrder1m,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions v2/websocket_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ type WsAggTradeEvent struct {
LastBreakdownTradeID int64 `json:"l"`
TradeTime int64 `json:"T"`
IsBuyerMaker bool `json:"m"`
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshaling
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshalling
}

// WsTradeHandler handle websocket trade event
Expand Down Expand Up @@ -476,7 +476,7 @@ type WsTradeEvent struct {
SellerOrderID int64 `json:"a"`
TradeTime int64 `json:"T"`
IsBuyerMaker bool `json:"m"`
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshaling
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshalling
}

type WsCombinedTradeEvent struct {
Expand Down

0 comments on commit a387a5b

Please sign in to comment.