public function transform(Block $block)
 {
     return ['hash' => (string) $block->hash, 'version' => (int) $block->version, 'merkle' => (string) $block->merkle, 'time' => (int) $block->time, 'size' => (int) $block->size, 'main-chain' => (bool) $block->longest, 'nonce' => (int) $block->nonce, 'height' => (int) $block->height, 'prev-block-hash' => (string) $block->prev_block_hash, 'next-block-hash' => (string) $block->next_block_hash, 'difficulty' => (double) calculateDifficulty($block->nbits), 'work' => (string) $block->work, 'sent' => (int) $block->value_in, 'mining-fee' => (int) $block->miner_reward - ($block->value_out - $block->value_in), 'block-reward' => (int) $block->value_out - $block->value_in];
 }
 public function transform($data)
 {
     return ['network-height' => (int) $data->mining_info->blocks, 'database-height' => (int) $data->last_block->height, 'database-sync-progress' => (int) round($data->last_block->height / $data->mining_info->blocks * 100 * 100) / 100, 'difficulty' => (double) calculateDifficulty($data->last_block->nbits), 'mhps' => (double) $data->mining_info->networkhashps / 1000000, 'time-since-block' => (int) time() - $data->last_block['time'], 'total-omc' => (int) $data->last_block->total_value, 'omc-btc-price' => (double) $data->omc_btc_price, 'omc-usd-price' => (double) $data->omc_btc_price * $data->btc_usd_price, 'market-cap' => (double) ($data->last_block->total_value / pow(10, 8)) * $data->omc_btc_price * $data->btc_usd_price, 'block-reward' => (int) calculateReward($data->last_block->height)];
 }