Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /sapi/v1/sub-account/universalTransfer Signature for this request is not valid. #639

Closed
wants to merge 1 commit into from

Conversation

hlongvu
Copy link

@hlongvu hlongvu commented Dec 1, 2024

A fix for wrong params and formParams set on api /sapi/v1/sub-account/universalTransfer

@xyq-c-cpp
Copy link
Collaborator

xyq-c-cpp commented Dec 3, 2024

If setFormParam is not replaced, can the problem be found in parseRequest ? @hlongvu

@xyq-c-cpp
Copy link
Collaborator

Have you ever used this interface in real life? I'm testing other similar interfaces with setFormParam and see if they work fine @hlongvu

@hlongvu
Copy link
Author

hlongvu commented Dec 4, 2024

I am using the fix on my bot and it's working fine.
the original v2.6.1 throw the "Signature for this request is not valid" error.
I take a look on the api example here and they put all variable on params https://www.postman.com/api-noob/binance-apis/request/hji0sli/universal-transfer-for-master-account

@xyq-c-cpp xyq-c-cpp mentioned this pull request Dec 4, 2024
@adshao
Copy link
Owner

adshao commented Dec 4, 2024

I am using the fix on my bot and it's working fine. the original v2.6.1 throw the "Signature for this request is not valid" error. I take a look on the api example here and they put all variable on params https://www.postman.com/api-noob/binance-apis/request/hji0sli/universal-transfer-for-master-account

Hi @hlongvu , Could you please share the code you used along with the debug log?
In the binance API document, both params in form and query string are accepted: doc

@hlongvu
Copy link
Author

hlongvu commented Dec 5, 2024

debuglog.log
@adshao @xyq-c-cpp here is the log for error on my end

Code:

masterAccount.Client.NewSubAccountUniversalTransferService(). FromEmail(masterAccount.AccountEmail). ToEmail(subAccountConfig.AccountEmail). FromAccountType("SPOT"). ToAccountType("USDT_FUTURE"). Asset("USDT"). Amount(fmt.Sprintf("%.0f", amount)). RecvWindow(50000). Do(context.Background())

@hlongvu
Copy link
Author

hlongvu commented Dec 5, 2024

Maybe related ccxt/ccxt#19491

@adshao
Copy link
Owner

adshao commented Dec 5, 2024

Maybe related ccxt/ccxt#19491

Thank you @hlongvu , I don't think this bug is caused by setFormParams, it should be some special symbols in email format which is encoded by URLEncode. @xyq-c-cpp is trying to fix it in #646

@adshao adshao closed this in #646 Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants