OKEX-ccxt.base.errors.AuthenticationError: requires `apiKey`
See original GitHub issueOS:WIN10
MY CODE:
import ccxt
#API登录
exchange = ccxt.okex({
'apiKey': 'myapikey',
'secret': 'mysecret',
'password': 'mypassword',
})
#代理设置
exchange = ccxt.okex({
'proxies': {
'http': 'http://127.0.0.1:10809', # these proxies won't work for you, they are here for example
'https': 'http://127.0.0.1:10809',
},
})
while True:
data1 = exchange.fetch_ticker(symbol="ZEN-USDT-SWAP")
new_price1 = data1["bid"]
A = new_price1
if A > 10:
print(A)
order_symbol = 'ZEN-USDT-SWAP'
order_type = 'limit'
order_side = 'sell'
order_amount = 0.1
order_price = 40
take_order = exchange.create_order(order_symbol, order_type, order_side, order_amount, order_price)
print(take_order)
else:
print("不挂单")
slice(10)
RESPON:
C:\Users\baiyun\anaconda3\envs\pythonProject\python.exe C:/Users/baiyun/PycharmProjects/pythonProject/taoli.py
Traceback (most recent call last):
File "C:/Users/baiyun/PycharmProjects/pythonProject/taoli.py", line 28, in <module>
take_order = exchange.create_order(order_symbol, order_type, order_side, order_amount, order_price)
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\okex.py", line 1883, in create_order
25.301
response = getattr(self, method)(self.extend(request, params))
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\base\exchange.py", line 465, in inner
return entry(_self, **inner_kwargs)
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\base\exchange.py", line 490, in request
return self.fetch2(path, api, method, params, headers, body)
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\base\exchange.py", line 485, in fetch2
request = self.sign(path, api, method, params, headers, body)
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\okex.py", line 3411, in sign
self.check_required_credentials()
File "C:\Users\baiyun\PycharmProjects\pythonProject\ccxt\base\exchange.py", line 1243, in check_required_credentials
raise AuthenticationError('requires `' + key + '`')
ccxt.base.errors.AuthenticationError: requires `apiKey`
Process finished with exit code 1
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
fetch_my_trades - binance requires `apiKey` · Issue #4936
ccxt.base.errors.AuthenticationError: binance requires apiKey. I'm fairly certain my apikeys are valid as I'm sending an order that gets ...
Read more >ccxt-dev/ccxt - Gitter
ccxt.base.errors.AuthenticationError: binance userDataStream endpoint requires apiKey credential. if I'm trying to do the same auth as on regular cctx.
Read more >Apikey is not authorize - Futures API
So the error is related to the test server. It is a new account and I am new at market currency. I just...
Read more >How to fix Invalid API-key, IP, or permissions for action error?
I believe this was the error I was running across in python. ... You will need to navigate to the directory your github-downloaded...
Read more >Exchanges — ccxt 2.4.71 documentation
Each class implements the public and private API for a particular crypto exchange. All exchanges are derived from the base Exchange class and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
C:\Users\baiyun\anaconda3\envs\pythonProject\python.exe C:/Users/baiyun/PycharmProjects/pythonProject/ccxt/github.py CCXT Version: 1.40.41 23.536 {‘info’: {‘error_message’: ‘’, ‘result’: ‘true’, ‘error_code’: ‘0’, ‘client_oid’: ‘’, ‘order_id’: ‘677419540482527235’}, ‘id’: ‘677419540482527235’, ‘clientOrderId’: None, ‘timestamp’: None, ‘datetime’: None, ‘lastTradeTimestamp’: None, ‘symbol’: ‘ZEN-USDT-SWAP’, ‘type’: ‘2’, ‘timeInForce’: None, ‘postOnly’: None, ‘side’: ‘sell’, ‘price’: None, ‘stopPrice’: None, ‘average’: None, ‘cost’: None, ‘amount’: None, ‘filled’: None, ‘remaining’: None, ‘status’: None, ‘fee’: None, ‘trades’: None} 23.541 {‘info’: {‘error_message’: ‘’, ‘result’: ‘true’, ‘error_code’: ‘0’, ‘client_oid’: ‘’, ‘order_id’: ‘677419557779836929’}, ‘id’: ‘677419557779836929’, ‘clientOrderId’: None, ‘timestamp’: None, ‘datetime’: None, ‘lastTradeTimestamp’: None, ‘symbol’: ‘ZEN-USDT-SWAP’, ‘type’: ‘2’, ‘timeInForce’: None, ‘postOnly’: None, ‘side’: ‘sell’, ‘price’: None, ‘stopPrice’: None, ‘average’: None, ‘cost’: None, ‘amount’: None, ‘filled’: None, ‘remaining’: None, ‘status’: None, ‘fee’: None, ‘trades’: None}
Process finished with exit code -1
Thank you! It is ok!