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

okex: add deposit/withdraw flag in currencies ccxt/ccxt#11107 #11313

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions js/okex.js
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ module.exports = class okex extends Exchange {
const chains = dataByCurrencyId[currencyId];
const networks = {};
let currencyActive = false;
let depositEnabled = undefined;
let withdrawEnabled = undefined;
for (let j = 0; j < chains.length; j++) {
const chain = chains[j];
const canDeposit = this.safeValue (chain, 'canDep');
Expand All @@ -945,6 +947,16 @@ module.exports = class okex extends Exchange {
const active = (canDeposit && canWithdraw && canInternal) ? true : false;
currencyActive = (currencyActive === undefined) ? active : currencyActive;
const networkId = this.safeString (chain, 'chain');
if (canDeposit && !depositEnabled) {
depositEnabled = true;
} else if (!canDeposit) {
depositEnabled = false;
}
if (canWithdraw && !withdrawEnabled) {
withdrawEnabled = true;
} else if (!canWithdraw) {
withdrawEnabled = false;
}
if (networkId.indexOf ('-') >= 0) {
const parts = networkId.split ('-');
const chainPart = this.safeString (parts, 1, networkId);
Expand All @@ -963,6 +975,8 @@ module.exports = class okex extends Exchange {
'id': networkId,
'network': network,
'active': active,
'deposit': canDeposit,
'withdraw': canWithdraw,
'fee': this.safeNumber (chain, 'minFee'),
'precision': undefined,
'limits': {
Expand All @@ -980,6 +994,8 @@ module.exports = class okex extends Exchange {
'id': currencyId,
'name': undefined,
'active': currencyActive,
'deposit': depositEnabled,
'withdraw': withdrawEnabled,
'fee': undefined,
'precision': precision,
'limits': {
Expand Down