const axios = require('axios'); var { account_config } = require('../config/config.js'); const logger = require('./logger.js'); var url = account_config.CZZ_BASEURL const withdraw = async (params) => { params.privateKey = '' params.toAddress = params.receiver logger.info('withdraw_czz', process.env.NODE_ENV, url, ' params ', params) var data = { ...params } return new Promise(resolve => { axios.post(url + '/withdraw', data) .then(res => { console.log('res=>', res.status, res.data); resolve(res.data) }).catch(err => { logger.error('http_request_post error ', JSON.stringify(err)); resolve(JSON.stringify(err)) }); }) } module.exports = { withdraw }