src/blockchain/lib/web3Helpers.js
/**
 * recursively execute all requests in batches of 100
 *
 * @param {object} web3 Web3 instance
 * @param {array} requests array of Web3 request objects
 */
recursively execute all requests in batches of 100
@param {object} web3 Web3 instance
@param {array} requests array of Web3 request objects
recursively execute all requests in batches of 100 @param { object } web3 Web3 instance @param { array } requests array of Web3 request objects
function batchAndExecuteRequests(web3, requests) {
  if (requests.length === 0) return;
  try {
    const batch = new web3.BatchRequest();
    requests.splice(0, 100).forEach(r => batch.add(r));
    batch.execute();
    batchAndExecuteRequests(web3, requests);
  } catch (e) {
  }
}
function batchAndExecuteRequests ( web3 , requests ) { if ( requests . length === 0 ) return ; try { const batch = new web3 . BatchRequest ( ) ; requests . splice ( 0 , 100 ) . forEach ( r => batch . add ( r ) ) ; batch . execute ( ) ; batchAndExecuteRequests ( web3 , requests ) ; } catch ( e ) { } }
recursively execute all requests in batches of 100
 @param {object} web3 Web3 instance
 @param {array} requests array of Web3 request objects
recursively execute all requests in batches of 100 @param { object } web3 Web3 instance @param { array } requests array of Web3 request objects
//  console.log(e); TODO: Add appropriate log