jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.58k stars 768 forks source link

Fix signature error with email in params #862 #863

Open koders opened 2 years ago

koders commented 2 years ago

There is an issue with signature creation for requests involving emails (subaccount requests).

The query params are encoded and then the signature is created from encoded query, but for the signature to be correct, it has to be created on decoded query, and encoded after signature is created.

email=xxx%40xxx.com this is encoded, and therefore creates wrong signature, so we need to decode it, when creating the signature.

I encountered this only for emails in params, but could also happen in other cases

Issue #862