How do I use an API key/secret on Binance's TestNet?

2.3k views Asked by At

Following the instructions here, https://docs.binance.org/smart-chain/wallet/arkane.html, I created a Binance SmartChain account with its "0x" prefixed wallet address. I then added funds. What I can't figure out is how I get a TestNet API key and secret so that I can test my Python API calls. I create the client like so

from binance.client import Client
...
auth_client = Client(key, b64secret)
 if account.testing:
    auth_client.API_URL = 'https://testnet.binance.vision/api'

How do I get an API key tied to my Binance SmartChain address?

1

There are 1 answers

0
Asil On

You have to create your API credentials from here and pass the testnet variable into the Client constructor. See the documentation.

auth_client = Client(key, b64secret, testnet=True)

does the job.