Merged
Conversation
As properties `timestamp` and `recvWindow` change after variable `query` is ready, generated signature wouldn't be valid because final query would be different from the one used to generate signature, resulting in the error: `(code=-1022): Signature for this request is not valid`
Collaborator
|
@bway-dev thanks for your contribution! |
Collaborator
|
Collaborator
|
@bway-dev we have released a new version with this fix (node-binance-api@1.0.14). Thanks once again! |
Contributor
Author
|
Hi,
No problem.
I had to do another change, but I am not sure if I am using this in a bad
way, but the flow is this:
- I am using binance.sell with type STOP_LOSS_LIMIT
- It is then transformed in your API in a call to order function
- this binance order will get the side sell or buy
- and to this order is passed the LIMIT type in your API also even I am
passing STOP_LOSS or STOP_LOSS_LIMIT
- from there in order function it will be checked this:
if (params.stopPrice) {
request.stopPrice = params.stopPrice;
if (!allowedTypesForStopAndTrailing.includes(request.type)) {
throw Error('stopPrice: Must set "type" to one of the following: STOP_LOSS,
STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT');
}
}
- and as I have a stopPrice because i was calling sell function with
STOP_LOSS_LIMIT as it is passed a static LIMIT an error is thrown.
- I had to change the first parameter when calling order function inside
sell function from "LIMIT" to flags.type like this:
return await this.order(flags.type, 'SELL', symbol, quantity, price, flags);
in order to get no error as this was a STOP_LOSS_LIMIT sell.
If you see this is a real issue, I can submit a PR.
Best regards
João
carlosmiei ***@***.***> escreveu (quinta, 11/09/2025 à(s)
15:52):
… *carlosmiei* left a comment (ccxt/node-binance-api#956)
<#956 (comment)>
@bway-dev <https://github.com/bway-dev> we have released a new version
with this fix ***@***.***). Thanks once again!
—
Reply to this email directly, view it on GitHub
<#956 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5X76TFCSJQSMZZWONH3E33SGEBLAVCNFSM6AAAAACGCO4DWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEOBRGIYDEMJRGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As properties
timestampandrecvWindowchange after variablequeryis ready, generated signature wouldn't be valid because final query would be different from the one used to generate signature, resulting in the error:(code=-1022): Signature for this request is not valid