tiagosiebler / binance

Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
728 stars 264 forks source link

Custom URL or Endpoint #410

Closed ozum closed 4 months ago

ozum commented 4 months ago

Hi,

Thank you for this tremendous open-source library.

I want to use some endpoints that need to be implemented in this library. If possible, I may access them via URL and handle the raw result using the MainClient.

Of course, I can use a separate Axios client for that, but I don't prefer it because I don't want to handle authorization, key/secret processing, etc.

I prefer something like below:

const restClient = new MainClient({ api_key, api_secret });
const accountInfo = await restClient.getAccountInformation();

const rawData = await restClient.post("/api/v3/sor/order", { symbol, side, ... }); // <------ IS IT POSSIBLE?

If not possible, adding such a feature helps because developers can use this library even for endpoints that still need to be implemented instead of waiting for them to be implemented.

Many thanks for considering my request.

tiagosiebler commented 4 months ago

Possible, yes, but I would prefer to get them implemented in to the main client so you don't have to use the lower-level network calls directly.

I try to be quick with reviewing any pull requests, so if you do see any endpoints that aren't available yet, make a pull request and I'll do my best to get them reviewed/merged/reviewed quickly.

If there's lower-priority endpoints that you need but don't have the time to work on a PR yet, you can also open an issue to make me aware of the missing functionality (such as this one). Probably won't be as fast in addressing this as I would be for a PR, but it's the next best thing and I'll do my best to address it.

ozum commented 4 months ago

There are two endpoints: POST /api/v3/sor/order/test POST /api/v3/sor/order

https://binance-docs.github.io/apidocs/spot/en/#new-order-using-sor-trade

However, I want to try a few ideas on those endpoints. Only after my trials can I decide whether they are useful, so I don't want to open an issue and steal your time if they are not useful (for my purposes).

tiagosiebler commented 4 months ago

However, I want to try a few ideas on those endpoints. Only after my trials can I decide whether they are useful, so I don't want to open an issue and steal your time if they are not useful (for my purposes).

I appreciate the thought! However, if it's a missing endpoint (or type), I'd prefer to know about it so we can work on getting it added. This also helps me get an idea of which endpoints are more in demand vs once that are missing but probably won't be used.

ozum commented 4 months ago

Thanks, I opened a new issue for them here: #411

tiagosiebler commented 4 months ago

Released via #412, will be on npm shortly with v2.10.2. Thanks!