|
|
@ -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)
|
|
|
|