gateio / gateapi-python

250 stars 92 forks source link

Rebasing info #50

Closed Kalindro closed 3 years ago

Kalindro commented 3 years ago

Hello! Is there any part where API endpoints inform about currency "rebasing"? (whatever it is)? trade_status in list_currency_pairs() gives "tradable" status even tho I wouldn't call it tradable as not all actions can be taken on the pair then.

revilwang commented 3 years ago

Rebasing status currently is not returned, but there is an aggressive way to check if currency is rebasing. You can just place new orders and check GateApiException like this:

try:
    created = spot_api.create_order(order)
except GateApiException as e:
    if e.label in ('REBASING', 'INVALID_CURRENCY', 'INVALID_CURRENCY_PAIR'):
        print('rebasing")
Kalindro commented 3 years ago

Thanks @revilwang, having an exception for it also works!