From 3aaaecdecef03ca5ccb5f9be5bc3083a31f903e5 Mon Sep 17 00:00:00 2001 From: vee <897831508@qq.com> Date: Thu, 2 Dec 2021 18:46:52 +0800 Subject: [PATCH] 1234 --- utils/EthUtil.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/utils/EthUtil.js b/utils/EthUtil.js index bb5fec1..7de9779 100644 --- a/utils/EthUtil.js +++ b/utils/EthUtil.js @@ -12,15 +12,16 @@ if (typeof web3 !== 'undefined') { let eth = { + // //获取主币eth余额 - getBalance: async function(address) { - web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode)); - console.log("查询余额:",address) - let balance = await web3.eth.getBalance(address); - console.log("余额:",balance) - return Number(balance) / Math.pow(10, 18); - }, + // getBalance: async function(address) { + // web3 = new Web3(new Web3.providers.HttpProvider(systemConfiguration.constant.ethNode)); + // console.log("查询余额:",address) + // let balance = await web3.eth.getBalance(address); + // console.log("余额:",balance) + // return Number(balance) / Math.pow(10, 18); + // }, // //获取eth代币币余额 // getTokenBalance: async function(address, contract) { // console.log(address, contract) @@ -74,7 +75,7 @@ let eth = { // 获取bms,bmdt,usdt/erc余额 getTokenBalance: async function(address, contract, success) { web3 = new Web3(); - const data = { + const data = { 'jsonrpc': '2.0', 'id': '1', 'method': 'eth_call',