Procházet zdrojové kódy

change bsc withdraw

Rony před 2 roky
rodič
revize
fe48053d90
3 změnil soubory, kde provedl 15 přidání a 14 odebrání
  1. 3 4
      model/http_withdraw.js
  2. 3 1
      model/moralis_sdk.js
  3. 9 9
      model/utils.js

+ 3 - 4
model/http_withdraw.js

@@ -1,4 +1,3 @@
-
 const axios = require('axios');
 
 
@@ -8,11 +7,11 @@ const logger = require('./logger.js');
 var url = account_config.CZZ_BASEURL
 
 
-const withdraw = async (params) => {
+const withdraw = async(params) => {
     params.privateKey = ''
     params.toAddress = params.receiver
     logger.info('http-withdraw', process.env.NODE_ENV, url, ' params ', params)
-    var data = { ...params }
+    var data = {...params }
     return new Promise(resolve => {
         axios.post(url + '/withdraw', data, { timeout: 5 * 60 * 1000 })
             .then(res => {
@@ -26,7 +25,7 @@ const withdraw = async (params) => {
 }
 
 
-const check_withdraw_status = async (params) => {
+const check_withdraw_status = async(params) => {
     logger.info('txn_status_czz', process.env.NODE_ENV, url, ' params ', params)
     var pars = {
         txn_hash: params.hash,

+ 3 - 1
model/moralis_sdk.js

@@ -1083,7 +1083,9 @@ async function transfer_(opts) {
     if (opts.receiver) {
         opts.receiver = utils.trim(opts.receiver)
     }
-    if (opts.chainId == utils.CHAIN_ID.bsc_testnet || opts.chainId == utils.CHAIN_ID.bsc_mainnet) {
+    // if (opts.chainId == utils.CHAIN_ID.bsc_testnet || opts.chainId == utils.CHAIN_ID.bsc_mainnet) {
+    if (false) {
+
         var options;
         // sending 0.5 DAI tokens with 18 decimals on BSC testnet
         if (opts.contractAddress) { //如果存在就是代币

+ 9 - 9
model/utils.js

@@ -78,10 +78,10 @@ function encrypt(data) {
 }
 
 /**
-* 解密方法
-* @param data
-* @returns {string}
-*/
+ * 解密方法
+ * @param data
+ * @returns {string}
+ */
 function decrypt(data) {
     // const key = CryptoJS.enc.Hex.parse(SECRET_KEY);
     const decrypt = CryptoJS.AES.decrypt(data, SECRET_KEY, {
@@ -125,7 +125,7 @@ const CHAIN_ID = {
 
 const CHAIN_ID_NAME = {
     97: 'bsc_testnet',
-    56: 'bsc_mainnet',
+    56: 'bsc',
     2019: 'czz',
     65: 'okc',
     66: 'okc',
@@ -168,7 +168,7 @@ function getRedisKeyFromChain(chain) {
 }
 
 function getChainNameFromChain(chain) {
-    logger.info('getChainNameFromChain',chain)
+    logger.info('getChainNameFromChain', chain)
     switch (chain) {
         case CHAIN_NAME.bsc_mainnet:
         case CHAIN_NAME.bsc_testnet:
@@ -263,8 +263,8 @@ function chinaTimeMs(ms) {
 
 function getLastDay(day, format) {
     return day ?
-        moment().subtract(day, 'day').tz('Asia/Shanghai').format(format)
-        : moment().subtract(1, 'day').tz('Asia/Shanghai').format(format)
+        moment().subtract(day, 'day').tz('Asia/Shanghai').format(format) :
+        moment().subtract(1, 'day').tz('Asia/Shanghai').format(format)
 }
 
 function getTimestampToDate(tm) {
@@ -292,7 +292,7 @@ function scientificNotationToString(param) {
         }
         // 指数
         let index = Number(strParam.match(/\d+$/)[0])
-        // 基数
+            // 基数
         let basis = strParam.match(/^[\d\.]+/)[0].replace(/\./, '')
 
         if (sysbol) {