Checks a list of responses from one same POST request to different coordinators
If all responses are errors, throw the error
If at least 1 was successful, return it
@param {Array} responsesArray - An array of responses, including errors
@returns response
@throws Axios Error
GET request to the /accounts/:accountIndex endpoint. Returns a specific token account for an accountIndex
@param {string} accountIndex - Account index in the format hez:DAI:4444
@returns {object} Response data with the token account
GET request to the /accounts endpoint. Returns a list of token accounts associated to a Hermez address
@param {string} address - The account's address. It can be a Hermez Ethereum address or a Hermez BabyJubJub address
@param {int[]} tokenIds - Array of token IDs as registered in the network
@param {int} fromItem - Item from where to start the request
@returns {object} Response data with filtered token accounts and pagination data
GET request to the /batches/:batchNum endpoint. Returns a specific batch
@param {int} batchNum - Number of a specific batch
@returns {Object} Response data with a specific batch
GET request to the /batches endpoint. Returns a filtered list of batches
@param {String} forgerAddr - Filter by forger address
@param {int} slotNum - A specific slot number
@param {int} fromItem - Item from where to start the request
@returns {Object} Response data with a paginated list of batches
GET request to the /bids endpoint. Returns a list of bids
@param {int} slotNum - Filter by slot
@param {String} bidderAddr - Filter by coordinator
@param {int} fromItem - Item from where to start the request
@returns {Object} Response data with the list of slots
GET request to the /coordinators/:bidderAddr endpoint. Returns a specific coordinator information
@param {String} forgerAddr - A coordinator forger address
@param {String} bidderAddr - A coordinator bidder address
@returns {Object} Response data with a specific coordinator
GET request to the /exits/:batchNum/:accountIndex endpoint. Returns a specific exit
@param {int} batchNum - Filter by an exit in a specific batch number
@param {string} accountIndex - Filter by an exit associated to an account index
@returns {object} Response data with the specific exit
GET request to the /exits endpoint. Returns a list of exits based on certain filters
@param {string} address - Filter by the address associated to the exits. It can be a Hermez Ethereum address or a Hermez BabyJubJub address
@param {boolean} onlyPendingWithdraws - Filter by exits that still haven't been withdrawn
@returns {object} Response data with the list of exits
Makes sure a list of next forgers includes the base API URL
@param {Array} nextForgerUrls - Array of forger URLs that may or may not include the base API URL
@returns nextForgerUrls - Array of next forgers that definitely includes the base API URL
GET request to the /transactions-history/:transactionId endpoint. Returns a specific forged transaction
@param {string} transactionId - The ID for the specific transaction
@returns {object} Response data with the transaction
Sets the query parameters related to pagination
@param {int} fromItem - Item from where to start the request
@returns {object} Includes the values fromItem and limit
@private
GET request to the /transactions-pool/:transactionId endpoint. Returns a specific unforged transaction
@param {string} transactionId - The ID for the specific transaction
@returns {object} Response data with the transaction
GET request to the /slots/:slotNum endpoint. Returns the information for a specific slot
@param {int} slotNum - The nunmber of a slot
@returns {Object} Response data with a specific slot
GET request to the /tokens/:tokenId endpoint. Returns a specific token
@param {int} tokenId - A token ID
@returns {object} Response data with a specific token
GET request to the /tokens endpoint. Returns a list of token data
@param {int[]} tokenIds - An array of token IDs
@returns {object} Response data with the list of tokens
GET request to the /transactions-histroy endpoint. Returns a list of forged transaction based on certain filters
@param {string} address - Filter by the address that sent or received the transactions. It can be a Hermez Ethereum address or a Hermez BabyJubJub address
@param {int[]} tokenIds - Array of token IDs as registered in the network
@param {int} batchNum - Filter by batch number
@param {String} accountIndex - Filter by an account index that sent or received the transactions
@param {int} fromItem - Item from where to start the request
@returns {object} Response data with filtered transactions and pagination data
POST request to the /account-creation-authorization endpoint. Sends an authorization to the coordinator to register token accounts on their behalf
@param {String} hezEthereumAddress - The Hermez Ethereum address of the account that makes the authorization
@param {String} bjj - BabyJubJub address of the account that makes the authorization
@param {String} signature - The signature of the request
@returns {Object} Response data
POST request to the /transaction-pool endpoint. Sends an L2 transaction to the network
@param {object} transaction - Transaction data returned by TxUtils.generateL2Transaction
@returns {string} Transaction id