Skip to content

Conversation

@mzaeemnasir
Copy link

Add close-all-postions endpoint that was missing.

/close-all-positions

Add close-all-postions endpoint that was missing.
params["productType"] = productType
return self._request_with_params(POST, MIX_ORDER_V1_URL + '/close-all-positions', params)
else:
logger.error("pls check args")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a python expert, but, couldn't you type the parameter productType like:

def mix_cp_close_all_positions(self, productType: str):

And then you don't need this check?
If this does not work, it would be nice if the log message is more verbose:

logger.error("Parameter `productType` is missing")

Anyways, I suggest raising an exception, that can be handled from the outside, if the API can't work without the productType parameter.

Copy link
Author

@mzaeemnasir mzaeemnasir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated mix_cp_close_all_positions function

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

Successfully merging this pull request may close these issues.

2 participants