I can help you with it. The error message in the section indicates that the HMAC Sha 256 signature is not properly created. Here is a step -by -step guide to help solve the problem:

Step 1: To secure the secret key

Before sending the HMAC Sha 256 signature, make sure that the secret key (config.secret_key) is correct and has not been compromised.

`Python

import bin

Replace the application subscription key and secret key

API_KEY = “Your_API_KEY”

Secret_key = “your_secret_key”

API_CONFIG = {

“API_KEY”: API_KEY,

“Secret_key”: Secret_key

}

Create the HMAC Sha 256 signature

Signature = binance.api_sign_x_sign (config.api_KEY, config.secret_key)

`

Step 2: Use the correct Binance API end point

Make sure you are using the right end point to send stores to the Binance application subscription. The end point is https: // api.binance.com/API/V3/MyTrades.

`Python

Set the API terminal point

endpoint = “

`

Step 3: Refresh HMAC Signature Generation

Ethereum: how to send HMAC SHA 256 Secret key to binance api?

In order to create the HMAC Sha 256 signature, you must use the binance.api_sign_X_Sign function and provide the right parameters.

`Python

Set the HMAC signature formation parameters

API_CONFIG = {

“API_KEY”: API_KEY,

“Secret_key”: Secret_key

}

Create the HMAC Sha 256 signature

try:

Signature = Binance.api_Sign_X_Sign (endpoint, API_CONFIG)

Except the exception as E:

Deal with exceptions that take place during the signature generation

Print (F “Creating Errors HMAC Sha 256 Signature: {E}”)

`

Other Recommendations

  • Make sure your secret key is not encoded in your code. Consider the use of environmental variables or safe secrets management solution.

  • If you use Python’s built -in Hashlib library to sign stores to sign, make sure you use the right parameters and algorithms of the HMAC Sha 256.

  • When creating signatures, always use the same secret key for all API functions.

Here’s an updated version of your code containing these recommendations:

`Python

import bin

Bring the hashlib

Replace the application subscription key and secret key

API_KEY = “Your_API_KEY”

Secret_key = “your_secret_key”

Set the Binance API terminal

endpoint = “

Def Generate_hmac_Signature (API_CONFIG):

Create the HMAC Sha 256 signature with HashLib Library

Signature = hashlib.sha256 ()

Signature.update (str.encode (API_CONFIG [“API_KEY”]))))

Signature.update (str.encode (Secret_key))

Return signature.hx ()

Set the HMAC signature formation parameters

API_CONFIG = {

“API_KEY”: API_KEY,

“Secret_key”: Secret_key

}

Create the HMAC Sha 256 signature

Signature = Generate_hmac_Signature (API_CONFIG)

`

By following these steps and recommendations, you should be able to solve all the problems in creating the HMAC Sha 256 active signatures for your Binance application subscription.

Ethereum Signing Trezor

Leave A Comment

Your email address will not be published. Required fields are marked *