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

Trying to insert a new ERC20 token and getting error #28

Open
blockchainbrazil opened this issue Jan 14, 2024 · 4 comments
Open

Trying to insert a new ERC20 token and getting error #28

blockchainbrazil opened this issue Jan 14, 2024 · 4 comments

Comments

@blockchainbrazil
Copy link

Traceback (most recent call last):
File "manage.py", line 16, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.8/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/app/cryptocoins/management/commands/add_token.py", line 162, in handle
is_price_external = binance_data_source.is_pair_exists(pair_to_usdt) or kucoin_data_source.is_pair_exists(
File "/app/cryptocoins/data_sources/crypto.py", line 37, in is_pair_exists
binance_client = BinanceClient()
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 300, in init
self.ping()
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 526, in ping
return self._get('ping', version=self.PRIVATE_API_VERSION)
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 371, in _get
return self._request_api('get', path, signed, version, **kwargs)
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 334, in _request_api
return self._request(method, uri, signed, **kwargs)
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 315, in _request
return self._handle_response(self.response)
File "/usr/local/lib/python3.8/site-packages/binance/client.py", line 324, in _handle_response
raise BinanceAPIException(response, response.status_code, response.text)
binance.exceptions.BinanceAPIException: APIError(code=0): Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error.

@mo-bay
Copy link

mo-bay commented Feb 20, 2024

It seems like the issue is occurring due to a restriction imposed by Binance. The traceback indicates that the API request made to Binance's service is being blocked because it's coming from a restricted location.

@gnutirt
Copy link

gnutirt commented Jun 6, 2024

If token, you must check this code

for currency_id in coin_list:
            # if currency_id in [USDT, BTC, TON, DOGE,PEPE,SHIB,FLOKI,MEME,BABYDOGE]:
            if currency_id in [USDT, BTC, TON, DOGE,PEPE,MEME,CAKE]:
                continue

            currency = Currency.get(currency_id)
            if not Keeper.objects.filter(currency=currency).exists():
                k_password, keeper = keeper_create(currency)
                gas_password, gas_keeper = keeper_create(currency, True)
                to_write.append(f'{currency.code} Info')
                to_write.append(f'Keeper address: {keeper.user_wallet.address}, Password: {k_password}')
                to_write.append(f'GasKeeper address: {gas_keeper.user_wallet.address}, Password: {gas_password}')
                to_write.append('='*10)
            else:
                to_write.append(f'{currency.code} Info')
                to_write.append('Keeper and GasKeeper exists, see previous file')
                to_write.append('=' * 10)

@EVMBotDev
Copy link

If token, you must check this code

for currency_id in coin_list:
            # if currency_id in [USDT, BTC, TON, DOGE,PEPE,SHIB,FLOKI,MEME,BABYDOGE]:
            if currency_id in [USDT, BTC, TON, DOGE,PEPE,MEME,CAKE]:
                continue

            currency = Currency.get(currency_id)
            if not Keeper.objects.filter(currency=currency).exists():
                k_password, keeper = keeper_create(currency)
                gas_password, gas_keeper = keeper_create(currency, True)
                to_write.append(f'{currency.code} Info')
                to_write.append(f'Keeper address: {keeper.user_wallet.address}, Password: {k_password}')
                to_write.append(f'GasKeeper address: {gas_keeper.user_wallet.address}, Password: {gas_password}')
                to_write.append('='*10)
            else:
                to_write.append(f'{currency.code} Info')
                to_write.append('Keeper and GasKeeper exists, see previous file')
                to_write.append('=' * 10)

What must we check in that code?

@cryptoIRAfinance
Copy link

It seems like the issue is occurring due to a restriction imposed by Binance. The traceback indicates that the API request made to Binance's service is being blocked because it's coming from a restricted location.

This is correct. Binance is region locked in many parts of the world. I fixed this by adding additional data sources, and adjust the call logic to ensure data if not call other data source. it's a bit slower initially, but once running no issues.

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

No branches or pull requests

5 participants