cryptomkt / cryptomkt-python Goto Github PK
View Code? Open in Web Editor NEWCryptoMarket Python SDK
Home Page: https://developers.cryptomkt.com
License: Apache License 2.0
CryptoMarket Python SDK
Home Page: https://developers.cryptomkt.com
License: Apache License 2.0
El socket imprime el siguiente mensaje:
"disconnected from server
connected to server"
Y deja de actualizar los mercados. Un workaround que encontré es reiniciandolo. Alguna idea de por qué sucede esto?
Por algun motivo recibo el error "OPEN Packet not returned by server"
El código es simple, pero ¿tienen alguna idea del motivo?.
from cryptomarket.exchange.client import Client
import json
api_key = '######'
api_secret= '#######'
client = Client(api_key, api_secret)
socket = client.get_socket()
Hola!!
Soy nuevo en la comunidad y esto recién aprendiendo a programar en python.
Seguí las instrucciones y me aparecen dos problemas en la Consola:
No name 'exchange' in module 'cryptomarket'
Unable to import 'cryptomarket.exchange.client'
Alguna idea de qué puede estar pasando y cómo solucionarlo?
Muchas gracias!
Hola! No sé si este es el lugar adecuado para asuntos del API en general, entonces avísame si hay un lugar más apropiado.
No es de ninguna manera un gran problema, pero estoy viendo unas respuestas del endpoint /trades en las cuales uno o más de los trades van desordenados por timestamp.
Por ejemplo, en esta página hay unos timestamps "2019-05-14T19:08:10.273412", "2019-05-14T19:08:10.824139", "2019-05-14T19:08:09.453135".
# ...
{
"market_taker": "sell",
"timestamp": "2019-05-14T19:08:10.273412",
"price": "141540",
"amount": "0.086",
"market": "ETHCLP"
},
{
"market_taker": "buy",
"timestamp": "2019-05-14T19:08:10.824139", # este no pertinence aquí
"price": "144740",
"amount": "0.0172",
"market": "ETHCLP"
},
{
"market_taker": "sell",
"timestamp": "2019-05-14T19:08:09.453135",
"price": "141640",
"amount": "1.1631",
"market": "ETHCLP"
}
# ...
No sé si tal vez los lados opuestos del libro operan en una manera asíncrona o por qué pasaría esto.
Gracias y saludos.
Estoy intenando plotear los precios del último día/mes, pero lo único que retorna el método get_prices_history es un dict con una lista de un elemento, y siempre del mismo timestamp:
client.get_prices_history(
to='CLP',
source='BTC',
period='D1',
sort='ASC'
)
retorna
{'BTC': PriceHistory(currency='CLP', history=[PricePoint(timestamp='2021-10-31T00:00:00.000Z', open='50263551', close='50777399', min='49215836', max='51000000')])}
Sin importar los parámetros, history siempre parece tener un solo elemento. Estoy haciendo algo mal?
Hola!
Gracias por este paquete, me viene funcionando muy bien, quisiera agregarlo a requirements.txt en el bot que estoy haciendo, así siempre descargo la última versión con pip. pero me falla, diciendo que falta el archivo setup.py
, si me dan una ayuda, feliz les hago un PR para que este repo sea pip instalable.
Saludos!
Obtengo este internal_error
al solicitar una transferencia XLM , XXXX agregados intencionalmente. ¿Alguna idea que puede ser?
Traceback (most recent call last):
File "test.py", line XXXX, in <module>
salida=cryptomkt_client.transfer(address="XXXX",amount=1.0,currency="xlm",memo="XXXX")
File "XXXX/api_cryptomkt_python_test/cryptomkt-python-master/cryptomarket/exchange/client.py", line 520, in transfer
response = self._post(self.API_VERSION, "transfer", data = params)
File "XXXX/api_cryptomkt_python_test/cryptomkt-python-master/cryptomarket/exchange/client.py", line 93, in _post
return self._request('post', *args, **kwargs)
File "XXXX/api_cryptomkt_python_test/cryptomkt-python-master/cryptomarket/exchange/client.py", line 78, in _request
return self._handle_response(response)
File "XXXX/api_cryptomkt_python_test/cryptomkt-python-master/cryptomarket/exchange/client.py", line 86, in _handle_response
raise build_api_error(response)
cryptomarket.exchange.error.InternalServerError: APIError(id=): internal_error
Hi,
The command "pip install cryptomkt" not install the file WebSocket as it is shown in the repository
Hola!
Me pasa algo extraño con esta función y el mercado en ARS.
Cuando ejecuto client.get_executed_orders('XLMARS'), obtengo InvalidRequestError: APIError(id=): invalid_request
, lo mismo pasa con cualquier par de market terminado en ARS
, pero devuelve exitosamente el resultado de cualquier combinación con CLP.
Alguna sugerencia?
..../cryptomarket/exchange/client.pyc in _handle_response(self, response)
80 """
81 if not str(response.status_code).startswith('2'):
---> 82 raise build_api_error(response)
83 return response
De paso sugiero que este SDK devuelva mayor detalle del error que devuelve la API, si es posible.
Gracias!
API and python library work well for other information, like get the balance or any other public or private endpoint. But when I try to get all executed orders for any market give me some error:
message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.cryptomkt.com/v2/orders/executed?market=XLMCLP&limit=20&page=0')
The response body is empty. It happen every time that I run this for any valid Market where I have orders.
My testing code:
from cryptomarket.exchange.client import Client
import os
CRYPTOMKT_API_KEY = os.getenv('CRYPTOMKT_API_KEY')
CRYPTOMKT_API_SECRET = os.getenv('CRYPTOMKT_API_SECRET')
client = Client(CRYPTOMKT_API_KEY, CRYPTOMKT_API_SECRET)
orders = client.get_executed_orders(market="XLMCLP")
print(orders)
Output:
Traceback (most recent call last):
File "trades_history.py", line 9, in <module>
orders = client.get_executed_orders(market="XLMCLP")
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/cryptomarket/exchange/client.py", line 304, in get_executed_orders
response = self._get(self.API_VERSION, 'orders', 'executed', params=params)
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/cryptomarket/exchange/client.py", line 90, in _get
return self._request('get', *args, **kwargs)
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/cryptomarket/exchange/client.py", line 78, in _request
return self._handle_response(response)
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/cryptomarket/exchange/client.py", line 86, in _handle_response
raise build_api_error(response)
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/cryptomarket/exchange/error.py", line 78, in build_api_error
blob = blob or response.json()
File "/home/gustavo/dev/personal/turing/audit/venv/lib/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.