Skip to content

Commit

Permalink
Merge pull request #18729 from samgermain/coinex-withdraw-network
Browse files Browse the repository at this point in the history
coinex withdraw takes params["network"]
  • Loading branch information
kroitor committed Aug 1, 2023
2 parents c3c8c90 + 1a06d93 commit 31d62ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ts/src/coinex.ts
Expand Up @@ -294,6 +294,11 @@ export default class coinex extends Exchange {
'accountsById': {
'spot': '0',
},
'networks': {
'BEP20': 'BSC',
'TRX': 'TRC20',
'ETH': 'ERC20',
},
},
'commonCurrencies': {
'ACM': 'Actinium',
Expand Down Expand Up @@ -3743,17 +3748,21 @@ export default class coinex extends Exchange {
* @method
* @name coinex#withdraw
* @description make a withdrawal
* @see https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account015_submit_withdraw
* @param {string} code unified currency code
* @param {float} amount the amount to withdraw
* @param {string} address the address to withdraw to
* @param {string} tag
* @param {object} [params] extra parameters specific to the coinex api endpoint
* @param {string} [params.network] unified network code
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
*/
[ tag, params ] = this.handleWithdrawTagAndParams (tag, params);
this.checkAddress (address);
await this.loadMarkets ();
const currency = this.currency (code);
const networkCode = this.safeStringUpper (params, 'network');
params = this.omit (params, 'network');
if (tag) {
address = address + ':' + tag;
}
Expand All @@ -3763,6 +3772,9 @@ export default class coinex extends Exchange {
'actual_amount': parseFloat (amount), // the actual amount without fees, https://www.coinex.com/fees
'transfer_method': 'onchain', // onchain, local
};
if (networkCode !== undefined) {
request['smart_contract_name'] = this.networkCodeToId (networkCode);
}
const response = await this.privatePostBalanceCoinWithdraw (this.extend (request, params));
//
// {
Expand Down

0 comments on commit 31d62ca

Please sign in to comment.