code: function checkPoolBalance(feeMap) {
                  if (!Object.keys(feeMap).length) return [];
                  let final_fees = [];
                  for (let asset in feeMap) {
                      let feePoolBalance = feePoolMap[asset]
                          ? parseInt(feePoolMap[asset].fee_pool, 10)
                          : 0;
                      /* Fee pool balance insufficient, default to core*/
                      if (feeMap[asset].total > feePoolBalance) {
                          feeMap[asset].ops.forEach(opIndex => {
                              if (
                                  coreFees[opIndex].length === 2 &&
                                  "propIdx" in feeMap[asset]
                              ) {
                                  /* Proposal op */
                                  feeMap[asset].propIdx.forEach(prop_idx => {
                                      final_fees[prop_idx] =
                                          coreFees[opIndex][1][prop_idx];
                                  });
                              } else if (coreFees[opIndex].length === 2) {
                                  final_fees[opIndex] = coreFees[opIndex][0];
                              } else {
                                  final_fees[opIndex] = coreFees[opIndex];
                              }
                          });
                          /* Use the desired fee asset */
                      } else {
                          feeMap[asset].ops.forEach(opIndex => {
                              if (
                                  coreFees[opIndex].length === 2 &&
                                  "propIdx" in feeMap[asset]
                              ) {
                                  feeMap[asset].propIdx.forEach(prop_idx => {
                                      final_fees[prop_idx] =
                                          proposalFeesByAsset[asset][prop_idx];
                                  });
                              } else {
                                  final_fees[opIndex] =
                                      feesByAsset[asset][opIndex];
                              }
                          });
                      }
                  }
                  return final_fees;
              }
docs: /* Check fee pool balances for regular ops