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

Huobi - withdraw fix #16061

Closed
wants to merge 16 commits into from
Closed

Huobi - withdraw fix #16061

wants to merge 16 commits into from

Conversation

ttodua
Copy link
Member

@ttodua ttodua commented Dec 12, 2022

(this PR is based on #16024 so, should be reviewed after that PR is merged)

this PR fixes the inclusive-fees issue, as endpoint says: https://huobiapi.github.io/docs/spot/v1/en/#create-a-withdraw-request
you have to include fee in request to make an exact withdraw amount. otherwise, user will need to calculate fees on his own (from currencies->network->fee)

(related to #15789 and #16016)

@@ -1715,7 +1727,13 @@ module.exports = class Exchange {
}
}
}
return networkId;
if (this.options['hasUniqueNetworkIds']) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ttodua this option does not seem very "self-explanatory", what if instead of the option we checked the size of networkChainIdsByNames/networkNamesByChainIds ? If bigger than 0, means we have this logic, wdyt?

@@ -1741,6 +1773,11 @@ module.exports = class Exchange {
return networkCode;
}

getCommonNetworkNameFromId (networkId, currencyCode = undefined) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

isn't this basically "safeNetwork()"?

const response = await this.spotPrivatePostV1DwWithdrawApiCreate (this.extend (request, paramsOmited));
request['chain'] = this.networkCodeToId (networkCode, code);
}
amount = parseFloat (this.currencyToPrecision (code, amount, networkCode));
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ttodua can we replace all parseFloat occurrences with parseNumber ? parseFloat does not take into consideration the precision mode (float or string) chosen by the user

const chains = this.safeValue (entry, 'chains', []);
const networks = {};
this.options['networkChainIdsByNames'][code] = {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ttodua I know this is not the right place but can't highlight it now, but I just want to ask, aren't we missing the 'usdt' chain to represent the OMNI?
image
image

Copy link
Member Author

Choose a reason for hiding this comment

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

@carlosmiei no, there is no OMNI (at least, at this moment, might have been in the past).

you can see that https://api.huobi.pro/v2/reference/currencies and also when I visually check HUOBI withdraw page, there is also no "omni ( usdt )" ooption. there are only those 8 chains that you have screenshoted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ttodua ok never mind then, probably docs are outdated, thanks for checking it

@ttodua ttodua marked this pull request as draft December 15, 2022 11:22
@ttodua ttodua closed this Dec 15, 2022
@ttodua ttodua deleted the huobi-withdraw-fix branch December 15, 2022 17:56
@ttodua
Copy link
Member Author

ttodua commented Dec 15, 2022

replaced with #16024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants