binance-api-node icon indicating copy to clipboard operation
binance-api-node copied to clipboard

Update index.d.ts

Open macryptotechfin opened this issue 3 years ago • 10 comments

property name typo (notional -> minNotional)

macryptotechfin avatar May 28 '22 07:05 macryptotechfin

image

That's for futures, you need to replace it only for spot

yovanoc avatar May 28 '22 10:05 yovanoc

This is an extract of what I get when I directly call api/v3/exchangeInfo

As far as I can see, in MIN_NOTIONAL filter, it's called minNotional. Am I wrong or missing anything? ;-)

"symbols": [ { "symbol": "ETHBTC", "status": "TRADING", "baseAsset": "ETH", "baseAssetPrecision": 8, "quoteAsset": "BTC", "quotePrecision": 8, "quoteAssetPrecision": 8, "baseCommissionPrecision": 8, "quoteCommissionPrecision": 8, "orderTypes": [ "LIMIT", "LIMIT_MAKER", "MARKET", "STOP_LOSS_LIMIT", "TAKE_PROFIT_LIMIT" ], "icebergAllowed": true, "ocoAllowed": true, "quoteOrderQtyMarketAllowed": true, "allowTrailingStop": true, "isSpotTradingAllowed": true, "isMarginTradingAllowed": true, "filters": [ { "filterType": "PRICE_FILTER", "minPrice": "0.00000100", "maxPrice": "922327.00000000", "tickSize": "0.00000100" }, { "filterType": "PERCENT_PRICE", "multiplierUp": "5", "multiplierDown": "0.2", "avgPriceMins": 5 }, { "filterType": "LOT_SIZE", "minQty": "0.00010000", "maxQty": "100000.00000000", "stepSize": "0.00010000" }, { "filterType": "MIN_NOTIONAL", "minNotional": "0.00010000", "applyToMarket": true, "avgPriceMins": 5 }, { "filterType": "ICEBERG_PARTS", "limit": 10 }, { "filterType": "MARKET_LOT_SIZE", "minQty": "0.00000000", "maxQty": "1200.26865194", "stepSize": "0.00000000" }, { "filterType": "TRAILING_DELTA", "minTrailingAboveDelta": 10, "maxTrailingAboveDelta": 2000, "minTrailingBelowDelta": 10, "maxTrailingBelowDelta": 2000 }, { "filterType": "MAX_NUM_ORDERS", "maxNumOrders": 200 }, { "filterType": "MAX_NUM_ALGO_ORDERS", "maxNumAlgoOrders": 5 } ], "permissions": [ "SPOT", "MARGIN" ] }, .....

macryptotechfin avatar May 28 '22 16:05 macryptotechfin

Ohhh I do sorry! Now I catch your point. You are right. In Futures it's called notional...

maybe we can add both names as optionals... what do you think?

macryptotechfin avatar May 28 '22 16:05 macryptotechfin

I think it will be better to have different types for both spot and futures

yovanoc avatar May 28 '22 17:05 yovanoc

Done! Review changes, please ;-)

macryptotechfin avatar May 28 '22 17:05 macryptotechfin

No was thinking really different types for the exchangeInfos() methods, but im not the maintainer here, he will tell you

yovanoc avatar May 28 '22 18:05 yovanoc

I see.. let's wait till maintainer brings light...

macryptotechfin avatar May 29 '22 10:05 macryptotechfin

Haha well I don't really handle anything typings related, so it' would be mostly your call @yovanoc. @bennycode might be able to give his input but he might be busy

balthazar avatar May 29 '22 13:05 balthazar

So yeah I think it will be a lot clearer to have different types for futures and spot but you can do something like I did here: https://github.com/Ashlar/binance-api-node/commit/7225098fecb0337a9069cee9551022defa389144

yovanoc avatar May 29 '22 13:05 yovanoc

@balthazar we should look into options to generate TypeScript definitions OR progressively migrate this codebase to TypeScript. TypeScript can handle standard JavaScript with ease (using the allowJs compiler flag), so migrating step-by-step would be possible.

bennycode avatar May 30 '22 07:05 bennycode

Did something change Binance side with this? I've deployed spot code pinned to 0.11.36 that suddenly started failing on around the date you created this PR @macryptotechfin

subos2008 avatar May 03 '23 16:05 subos2008

this is what i get on https://api.binance.com/api/v3/exchangeInfo

PRICE_FILTER LOT_SIZE ICEBERG_PARTS MARKET_LOT_SIZE TRAILING_DELTA PERCENT_PRICE_BY_SIDE NOTIONAL MAX_NUM_ORDERS MAX_NUM_ALGO_ORDERS

moigithub avatar Jun 29 '23 14:06 moigithub

Yeah MIN_NOTIONAL filter has been renamed NOTIONAL and has minNotional and iirc maxNotional attributes now.

subos2008 avatar Jun 29 '23 17:06 subos2008

The MIN_NOTIONAL issue got fixed with this PR: https://github.com/ViewBlock/binance-api-node/pull/609

@balthazar I think this issue here can be closed now?!

bennycode avatar Aug 08 '23 11:08 bennycode

The right thing to do is to split these types for futures and spot. Because I had changed this type for futures usage.

yovanoc avatar Aug 08 '23 14:08 yovanoc

@bennycode I think you're right, closing

balthazar avatar Aug 11 '23 13:08 balthazar