tools/setup/fund_manager.js
function (owner) {
    const web3Provider = web3ProviderFactory.getProvider('value', 'ws')
    ;

    // Validate addresses
    if (!basicHelper.isAddressValid(owner)) {
      let errObj = responseHelper.error({
        internal_error_identifier: 't_s_fm_8',
        api_error_identifier: 'invalid_address',
        error_config: basicHelper.fetchErrorConfig()
      });
      return Promise.resolve(errObj);
    }

    return web3Provider.eth.getBalance(owner)
      .then(function(balance) {
        return responseHelper.successWithData({balance: balance});
      })
      .catch(function (err) {
        //Format the error
        logger.error(err);
        return responseHelper.error({
          internal_error_identifier: 't_s_fm_9',
          api_error_identifier: 'something_went_wrong',
          error_config: basicHelper.fetchErrorConfig()
        });
      });
  }
function (owner) {
    const web3Provider = web3ProviderFactory.getProvider('value', 'ws')
    ;

    // Validate addresses
    if (!basicHelper.isAddressValid(owner)) {
      let errObj = responseHelper.error({
        internal_error_identifier: 't_s_fm_8',
        api_error_identifier: 'invalid_address',
        error_config: basicHelper.fetchErrorConfig()
      });
      return Promise.resolve(errObj);
    }

    return web3Provider.eth.getBalance(owner)
      .then(function(balance) {
        return responseHelper.successWithData({balance: balance});
      })
      .catch(function (err) {
        //Format the error
        logger.error(err);
        return responseHelper.error({
          internal_error_identifier: 't_s_fm_9',
          api_error_identifier: 'something_went_wrong',
          error_config: basicHelper.fetchErrorConfig()
        });
      });
  }
function ( owner ) { const web3Provider = web3ProviderFactory . getProvider ( 'value' , 'ws' ) ; // Validate addresses if ( ! basicHelper . isAddressValid ( owner ) ) { let errObj = responseHelper . error ( { internal_error_identifier : 't_s_fm_8' , api_error_identifier : 'invalid_address' , error_config : basicHelper . fetchErrorConfig ( ) } ) ; return Promise . resolve ( errObj ) ; } return web3Provider . eth . getBalance ( owner ) . then ( function ( balance ) { return responseHelper . successWithData ( { balance : balance } ) ; } ) . catch ( function ( err ) { //Format the error logger . error ( err ) ; return responseHelper . error ( { internal_error_identifier : 't_s_fm_9' , api_error_identifier : 'something_went_wrong' , error_config : basicHelper . fetchErrorConfig ( ) } ) ; } ) ; }
Get ETH Balance of an address

@param {string} owner - address

@return {promise<result>}
Get ETH Balance of an address