Skip to content

Commit a387a5b

Browse files
authored
fix current existly typos (#582)
1 parent b3a9097 commit a387a5b

15 files changed

+59
-24
lines changed

.github/workflows/check.yml

+8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13+
TyposCheck:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: crate-ci/[email protected]
18+
with:
19+
config: ./typos.toml
20+
1321
UnitTest:
1422
runs-on: ubuntu-latest
1523
steps:

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Name | Description | Status
2323
[margin-api.md](https://binance-docs.github.io/apidocs/spot/en) | Details on the Margin API (/sapi) | <input type="checkbox" checked> Implemented
2424
[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | <input type="checkbox" checked> Implemented
2525
[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
26-
[options-api.md](https://binance-docs.github.io/apidocs/voptions/en/#general-info) | Detains on the Options API(/eapi) | <input type="checkbox" checked> Implemented
26+
[options-api.md](https://binance-docs.github.io/apidocs/voptions/en/#general-info) | Details on the Options API(/eapi) | <input type="checkbox" checked> Implemented
2727

2828

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

3131
### Installation
3232

typos.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[files]
2+
ignore-files = true
3+
ignore-hidden = false
4+
extend-exclude = [
5+
".git/",
6+
"v2/go.mod",
7+
"v2/go.sum",
8+
"v2/go.work.sum",
9+
]
10+
11+
12+
[default]
13+
extend-ignore-re=[
14+
"ios_54d9b18d8e7a4caf9d149573e16480ba",
15+
"Pn",
16+
"SIZ9",
17+
"alo",
18+
"ot",
19+
"[Cc]ummulative",
20+
"OTU",
21+
"[Tt]ransfered",
22+
]
23+
check-filename = true
24+
25+
26+
27+

v2/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
479479
}
480480
defer func() {
481481
cerr := res.Body.Close()
482-
// Only overwrite the retured error if the original error was nil and an
482+
// Only overwrite the returned error if the original error was nil and an
483483
// error occurred while closing the body.
484484
if err == nil && cerr != nil {
485485
err = cerr
@@ -1008,7 +1008,7 @@ func (c *Client) NewGetAllLiquidityPoolService() *GetAllLiquidityPoolService {
10081008
return &GetAllLiquidityPoolService{c: c}
10091009
}
10101010

1011-
// NewGetLiquidityPoolDetailService init the get liquidity pool detial service
1011+
// NewGetLiquidityPoolDetailService init the get liquidity pool detail service
10121012
func (c *Client) NewGetLiquidityPoolDetailService() *GetLiquidityPoolDetailService {
10131013
return &GetLiquidityPoolDetailService{c: c}
10141014
}
@@ -1043,7 +1043,7 @@ func (c *Client) NewClaimRewardService() *ClaimRewardService {
10431043
return &ClaimRewardService{c: c}
10441044
}
10451045

1046-
// NewRemoveLiquidityService init the service to remvoe liquidity
1046+
// NewRemoveLiquidityService init the service to remove liquidity
10471047
func (c *Client) NewRemoveLiquidityService() *RemoveLiquidityService {
10481048
return &RemoveLiquidityService{c: c, assets: []string{}}
10491049
}

v2/delivery/account_service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ type AccountAsset struct {
9393
AvailableBalance string `json:"availableBalance"`
9494
}
9595

96-
// AccountPosition define accoutn position
96+
// AccountPosition define account position
9797
type AccountPosition struct {
9898
Symbol string `json:"symbol"`
9999
PositionAmt string `json:"positionAmt"`

v2/delivery/account_service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func (s *accountServiceTestSuite) assertAccountEqual(e, a *Account) {
228228
r.Equal(e.Assets[i].MarginBalance, a.Assets[i].MarginBalance, "MarginBalance")
229229
r.Equal(e.Assets[i].MaxWithdrawAmount, a.Assets[i].MaxWithdrawAmount, "MaxWithdrawAmount")
230230
r.Equal(e.Assets[i].OpenOrderInitialMargin, a.Assets[i].OpenOrderInitialMargin, "OpenOrderInitialMargin")
231-
r.Equal(e.Assets[i].PositionInitialMargin, e.Assets[i].PositionInitialMargin, "PossitionInitialMargin")
231+
r.Equal(e.Assets[i].PositionInitialMargin, e.Assets[i].PositionInitialMargin, "PositionInitialMargin")
232232
r.Equal(e.Assets[i].UnrealizedProfit, a.Assets[i].UnrealizedProfit, "UnrealizedProfit")
233233
r.Equal(e.Assets[i].WalletBalance, a.Assets[i].WalletBalance, "WalletBalance")
234234
}

v2/delivery/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
331331
}
332332
defer func() {
333333
cerr := res.Body.Close()
334-
// Only overwrite the retured error if the original error was nil and an
334+
// Only overwrite the returned error if the original error was nil and an
335335
// error occurred while closing the body.
336336
if err == nil && cerr != nil {
337337
err = cerr

v2/dust_log_service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ type DustResult struct {
7070
// UserAssetDribblet represents one dust log row
7171
type UserAssetDribblet struct {
7272
OperateTime int64 `json:"operateTime"`
73-
TotalTransferedAmount string `json:"totalTransferedAmount"` //Total transfered BNB amount for this exchange.
73+
TotalTransferedAmount string `json:"totalTransferedAmount"` //Total transferred BNB amount for this exchange.
7474
TotalServiceChargeAmount string `json:"totalServiceChargeAmount"` //Total service charge amount for this exchange.
7575
TransID int64 `json:"transId"`
7676
UserAssetDribbletDetails []UserAssetDribbletDetail `json:"userAssetDribbletDetails"` //Details of this exchange.
7777
}
7878

79-
// DustLog represents one dust log informations
79+
// DustLog represents one dust log information
8080
type UserAssetDribbletDetail struct {
8181
TransID int `json:"transId"`
8282
ServiceChargeAmount string `json:"serviceChargeAmount"`

v2/futures/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
346346
}
347347
defer func() {
348348
cerr := res.Body.Close()
349-
// Only overwrite the retured error if the original error was nil and an
349+
// Only overwrite the returned error if the original error was nil and an
350350
// error occurred while closing the body.
351351
if err == nil && cerr != nil {
352352
err = cerr

v2/futures/websocket_service.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ type WsContinuousKline struct {
381381
ActiveBuyQuoteVolume string `json:"Q"`
382382
}
383383

384-
// WsContinuousKlineSubcribeArgs used with WsContinuousKlineServe or WsCombinedContinuousKlineServe
385-
type WsContinuousKlineSubcribeArgs struct {
384+
// WsContinuousKlineSubscribeArgs used with WsContinuousKlineServe or WsCombinedContinuousKlineServe
385+
type WsContinuousKlineSubscribeArgs struct {
386386
Pair string
387387
ContractType string
388388
Interval string
@@ -392,7 +392,7 @@ type WsContinuousKlineSubcribeArgs struct {
392392
type WsContinuousKlineHandler func(event *WsContinuousKlineEvent)
393393

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

412412
// WsCombinedContinuousKlineServe is similar to WsContinuousKlineServe, but it handles multiple pairs of different contractType with its interval
413-
func WsCombinedContinuousKlineServe(subscribeArgsList []*WsContinuousKlineSubcribeArgs,
413+
func WsCombinedContinuousKlineServe(subscribeArgsList []*WsContinuousKlineSubscribeArgs,
414414
handler WsContinuousKlineHandler, errHandler ErrHandler) (doneC, stopC chan struct{}, err error) {
415415
endpoint := getCombinedEndpoint()
416416
for _, val := range subscribeArgsList {

v2/futures/websocket_service_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ func (s *websocketServiceTestSuite) TestContinuousKlineServe() {
575575
s.mockWsServe(data, errors.New(fakeErrMsg))
576576
defer s.assertWsServe()
577577

578-
doneC, stopC, err := WsContinuousKlineServe(&WsContinuousKlineSubcribeArgs{
578+
doneC, stopC, err := WsContinuousKlineServe(&WsContinuousKlineSubscribeArgs{
579579
Pair: "BTCUSDT",
580580
ContractType: "PERPETUAL",
581581
Interval: "1m",
@@ -668,7 +668,7 @@ func (s *websocketServiceTestSuite) TestWsCombinedContinuousKlineServe() {
668668
s.mockWsServe(data, errors.New(fakeErrMsg))
669669
defer s.assertWsServe()
670670

671-
input := []*WsContinuousKlineSubcribeArgs{
671+
input := []*WsContinuousKlineSubscribeArgs{
672672
{
673673
Pair: "ETHBTC",
674674
ContractType: "PERPETUAL",

v2/liquidity_pool_service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ func (s *GetUserSwapRecordsService) SwapId(swapId int64) *GetUserSwapRecordsServ
294294
return s
295295
}
296296

297-
// StartTime set start time when swaping
297+
// StartTime set start time when swapping
298298
func (s *GetUserSwapRecordsService) StartTime(startTime int64) *GetUserSwapRecordsService {
299299
s.startTime = &startTime
300300
return s
301301
}
302302

303-
// EndTime set end time when swaping
303+
// EndTime set end time when swapping
304304
func (s *GetUserSwapRecordsService) EndTime(endTime int64) *GetUserSwapRecordsService {
305305
s.endTime = &endTime
306306
return s

v2/options/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ func (c *Client) callAPI(ctx context.Context, r *request, opts ...RequestOption)
349349
}
350350
defer func() {
351351
cerr := res.Body.Close()
352-
// Only overwrite the retured error if the original error was nil and an
352+
// Only overwrite the returned error if the original error was nil and an
353353
// error occurred while closing the body.
354354
if err == nil && cerr != nil {
355355
err = cerr

v2/options/order_service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ type Order struct {
179179
CreateTime int64 `json:"createTime"`
180180
UpdateTime int64 `json:"updateTime"`
181181
Status OrderStatusType `json:"status"`
182-
Reason *string `json:"reason"` // setted while query histroy orders.
182+
Reason *string `json:"reason"` // set while query history orders.
183183
AvgPrice string `json:"avgPrice"`
184184
Source string `json:"source"`
185185
ClientOrderId string `json:"clientOrderId"`
@@ -188,7 +188,7 @@ type Order struct {
188188
OptionSide OptionSideType `json:"optionSide"`
189189
QuoteAsset string `json:"quoteAsset"`
190190
Mmp bool `json:"mmp"`
191-
LastTrade *LastTrade `json:"lastTrade"` // order is immediately filled while calling create order, it will be setted.
191+
LastTrade *LastTrade `json:"lastTrade"` // order is immediately filled while calling create order, it will be set.
192192

193193
RateLimitOrder10s string `json:"rateLimitOrder10s,omitempty"`
194194
RateLimitOrder1m string `json:"rateLimitOrder1m,omitempty"`

v2/websocket_service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ type WsAggTradeEvent struct {
422422
LastBreakdownTradeID int64 `json:"l"`
423423
TradeTime int64 `json:"T"`
424424
IsBuyerMaker bool `json:"m"`
425-
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshaling
425+
Placeholder bool `json:"M"` // add this field to avoid case insensitive unmarshalling
426426
}
427427

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

482482
type WsCombinedTradeEvent struct {

0 commit comments

Comments
 (0)