Commits (3)
......@@ -2,6 +2,15 @@
Functions
*/
DROP FUNCTION IF EXISTS getUnixtime;
DELIMITER $$
CREATE FUNCTION getUnixtime(in_timestamp bigint(20))
RETURNS BIGINT(20) DETERMINISTIC
BEGIN
RETURN (SELECT in_timestamp + 1407722400);
END$$
DELIMITER ;
DROP FUNCTION IF EXISTS getPoolMinedAmount;
DELIMITER $$
CREATE FUNCTION getPoolMinedAmount(in_id bigint(20))
......@@ -267,7 +276,7 @@ CREATE TABLE `mosr` (
INDEX `idx` (`db_id`,`recipient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- DROP TABLE IF EXISTS mo;
-- DROP TABLE IF EXISTS ec_account;
CREATE TABLE `ec_account` (
`id` BIGINT(20) NOT NULL ,
`name` VARCHAR(100) NOT NULL,
......
......@@ -2,6 +2,15 @@
Functions
*/
DROP FUNCTION IF EXISTS getUnixtime;
DELIMITER $$
CREATE FUNCTION getUnixtime(in_timestamp bigint(20))
RETURNS BIGINT(20) DETERMINISTIC
BEGIN
RETURN (SELECT in_timestamp + 1407722400);
END$$
DELIMITER ;
DROP FUNCTION IF EXISTS getPoolMinedAmount;
DELIMITER $$
CREATE FUNCTION getPoolMinedAmount(in_id bigint(20))
......@@ -249,7 +258,7 @@ CREATE TABLE `mosr` (
INDEX `idx` (`db_id`,`recipient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- DROP TABLE IF EXISTS mo;
-- DROP TABLE IF EXISTS ec_account;
CREATE TABLE `ec_account` (
`id` BIGINT(20) NOT NULL ,
`name` VARCHAR(100) NOT NULL,
......
......@@ -4,14 +4,18 @@
namespace App\Controller;
use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Connection;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\Response;
use Exception;
class AccountController extends AbstractController
{
const AccountDetails = 'SELECT CAST(a.id AS UNSIGNED) as id,
FORMAT(a.balance/ 100000000, 2) as balance,
a.balance,
a.public_key,
a.name,
a.creation_height AS first_block,
......@@ -20,9 +24,11 @@ class AccountController extends AbstractController
getIncomingTransactionCountByAccountId(a.id) AS tx_in_count,
getOutgoingTransactionCountByAccountId(a.id) AS tx_out_count,
isPool(a.id) AS is_pool,
getPoolMinedAmount(a.id) / 100000000 AS pool_mined_amount,
getRewardedAmount(a.id) / 100000000 AS rewarded_amount,
a.forged_balance / 100000000 as solo_mined_amount,
getPoolMinedAmount(a.id) AS pool_mined_amount,
getRewardedAmount(a.id) AS rewarded_amount,
(SELECT count(bi.height) FROM block_info bi WHERE bi.recipient_id <> bi.generator_id AND bi.generator_id = a.id) AS forged_count,
(SELECT count(bi.height) FROM block_info bi WHERE bi.recipient_id <> bi.generator_id AND bi.recipient_id = a.id) AS rewarded_count,
a.forged_balance AS solo_mined_amount,
( SELECT CAST(rra.recip_id AS UNSIGNED)
FROM reward_recip_assign rra
WHERE rra.account_id = a.id AND rra.latest = 1) AS pool_id,
......@@ -30,8 +36,8 @@ class AccountController extends AbstractController
FROM reward_recip_assign rra
LEFT JOIN account pa ON (rra.recip_id = pa.id AND pa.latest = 1)
WHERE rra.account_id = a.id AND rra.latest = 1) AS pool_name,
FORMAT(( SELECT SUM(t.fee) FROM transaction t WHERE t.sender_id = a.id)/ 100000000, 2) AS fees_paid,
FORMAT(( SELECT SUM(t.amount) FROM transaction t WHERE t.sender_id = a.id)/ 100000000, 2) AS burst_sent,
( SELECT SUM(t.fee) FROM transaction t WHERE t.sender_id = a.id) AS fees_paid,
( SELECT SUM(t.amount) FROM transaction t WHERE t.sender_id = a.id) AS burst_sent,
( SELECT SUM(t.amount) FROM transaction t WHERE t.recipient_id = a.id) AS burst_recieved,
( SELECT SUM(mo.amount) FROM mo WHERE mo.recipient_id = a.id) AS mo_recieved,
( SELECT SUM(moss.amount)
......@@ -43,7 +49,47 @@ class AccountController extends AbstractController
WHERE CAST(mosr.recipient_id AS UNSIGNED) = ?
) as moss ) AS mos_recieved
FROM account a
WHERE CAST(a.id AS UNSIGNED) = ? AND a.latest = 1';
WHERE CAST(a.id AS UNSIGNED) = ? AND a.latest = 1 -- AccountController/AccountDetails';
const AccountForgedBlockIds = " SELECT b.db_id
FROM block_info bi
JOIN block b ON (b.height = bi.height)
WHERE bi.recipient_id <> bi.generator_id AND CAST(bi.generator_id AS UNSIGNED) = ?
ORDER BY b.db_id DESC
LIMIT ?,? -- AccountController/AccountForgedBlockIds";
const AccountRewardedBlockIds = " SELECT b.db_id
FROM block_info bi
JOIN block b ON (b.height = bi.height)
WHERE bi.recipient_id <> bi.generator_id AND CAST(bi.recipient_id AS UNSIGNED) = ?
ORDER BY b.db_id DESC
LIMIT ?,? -- AccountController/AccountRewardedBlockIds";
const AccountForgedBlockCount = " SELECT count(bi.generator_id) AS COUNT
FROM block_info bi
WHERE bi.recipient_id <> bi.generator_id AND CAST(bi.generator_id AS UNSIGNED) = ? -- AccountController/AccountForgedBlockCount";
const AccountRewardedBlockCount = " SELECT count(bi.generator_id) AS COUNT
FROM block_info bi
WHERE bi.recipient_id <> bi.generator_id AND CAST(bi.recipient_id AS UNSIGNED) = ? -- AccountController/AccountRewardedBlockCount";
const BlockDetails = " SELECT b.height,
CAST(b.id AS UNSIGNED) AS id,
getUnixtime(b.timestamp) AS unixtime,
getRewardByHeight(b.height) AS reward,
b.total_fee AS tx_fee,
b.total_amount AS sent,
bi.tx_count AS tx_count,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
CAST(bi.recipient_id AS UNSIGNED) AS pool,
ap.name AS pool_name
FROM block b
LEFT JOIN block_info bi ON (b.height = bi.height)
LEFT JOIN ec_account af ON (bi.generator_id = af.id)
LEFT JOIN ec_account ap ON (bi.recipient_id = ap.id)
WHERE b.db_id IN (?)
ORDER BY b.db_id DESC -- AccountController/BlockDetails";
private $entityManager;
......@@ -59,7 +105,6 @@ class AccountController extends AbstractController
public function accountDetails($id) {
$con = $this->entityManager->getConnection();
$stmt = $con->prepare(self::AccountDetails);
$stmt->bindValue(1, $id);
$stmt->bindValue(2, $id);
......@@ -70,4 +115,114 @@ class AccountController extends AbstractController
'account' => $account]);
}
/**
* Shows the forged Blocks of an AccountID
*
* @param $id
* @param $page
* @return Response
* @throws Exception
* @Route("/account/{id}/forged/{page}", name="account_details_forged", defaults={"page": 0}, requirements={"page"="\d+"})
*/
public function forgedBlocks($id, $page) {
return $this->getBlockList(
$id,
$page,
self::AccountForgedBlockCount,
self::AccountForgedBlockIds,
'account_details_forged',
true,
'forged-list'
);
}
/**
* Shows the rewarded Blocks of an AccountID
*
* @param $id
* @param $page
* @return Response
* @throws Exception
* @Route("/account/{id}/rewarded/{page}", name="account_details_rewarded", defaults={"page": 0}, requirements={"page"="\d+"})
*/
public function rewardedBlocks($id, $page) {
return $this->getBlockList(
$id,
$page,
self::AccountRewardedBlockCount,
self::AccountRewardedBlockIds,
'account_details_rewarded',
false,
'rewarded-list'
);
}
/**
* Meta Method for grabbing BlockInfo (forged or rewarded Blocks)
*
* @param $id
* @param $page
* @param $countQuery
* @param $idQuery
* @param $route
* @param $forged
* @param $listName
* @return Response
* @throws Exception
*/
private function getBlockList($id, $page, $countQuery, $idQuery, $route, $forged, $listName) {
$con = $this->entityManager->getConnection();
$start = BlockController::BlocksPerPage * $page;
// Get Count of Blocks which are visible in this case
$stmt = $con->executeQuery($countQuery, [$id]);
$BlockCount = $stmt->fetch();
// Get the IDs of the interesting Blocks
// we are doing this, to minimize the lookups of the queries
$stmt = $con->prepare($idQuery);
$stmt->bindValue(1, $id);
$stmt->bindValue(2, $start, ParameterType::INTEGER);
$stmt->bindValue(3, BlockController::BlocksPerPage, ParameterType::INTEGER);
$stmt->execute();
// Generate the ID-Array
$rows = $stmt->fetchAll();
$ids = [];
foreach($rows as $row) {
$ids[] = $row['db_id'];
}
// Get the Data for the Blocks we wan't to display
$stmt = $con->executeQuery(self::BlockDetails,
[$ids],
[Connection::PARAM_INT_ARRAY]);
$blocks = $stmt->fetchAll();
// Pagination Shit....
$lastPage = floor($BlockCount['COUNT'] / BlockController::BlocksPerPage);
$pageLinks = [];
for($i=$page; $i >= 0 && $i >= $page - 3 && $i <= $lastPage; $i--) {
$pageLinks[] = $i;
}
for($i=$page; $i >= $page && $i <= $page + 3 && $i <= $lastPage; $i++) {
$pageLinks[] = $i;
}
$pageLinks = array_unique($pageLinks);
sort($pageLinks);
// Return the rendered Page :-)
return $this->render('block.list.html.twig', [
'blocks' => $blocks,
'block_count' => $BlockCount['COUNT'],
'current_page' => $page,
'pageLinks' => $pageLinks,
'last_page' => $lastPage,
'forged' => $forged,
'route' => $route,
'id' => $id,
'list_name' => $listName,
]);
}
}
\ No newline at end of file
......@@ -14,10 +14,10 @@ class BlockController extends AbstractController
const BlockListByIds = 'SELECT b.height,
CAST(b.id AS UNSIGNED) AS id,
b.timestamp + 1407722400 AS unixtime,
getUnixtime(b.timestamp) AS unixtime,
getRewardByHeight(b.height) AS reward,
FORMAT(b.total_fee / 100000000, 2) AS tx_fee,
FORMAT(b.total_amount / 100000000, 2) AS sent,
b.total_fee AS tx_fee,
b.total_amount AS sent,
bi.tx_count AS tx_count,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
......@@ -35,9 +35,9 @@ class BlockController extends AbstractController
const BlockDetails = ' SELECT CAST(b.id AS UNSIGNED) AS id,
b.height,
bi.tx_count AS tx_count,
FORMAT(b.total_amount / 100000000, 2) AS sent,
FORMAT(b.total_fee / 100000000, 2) AS tx_fee,
b.timestamp + 1407722400 AS unixtime,
b.total_amount AS sent,
b.total_fee AS tx_fee,
getUnixtime(b.timestamp) AS unixtime,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
CAST(bi.recipient_id AS UNSIGNED) AS pool,
......@@ -45,7 +45,7 @@ class BlockController extends AbstractController
(b.timestamp - pb.timestamp) AS generation_time,
b.base_target,
b.payload_length AS size,
b.nonce,
CAST(b.nonce AS UNSIGNED) as nonce,
b.version,
getRewardByHeight(b.height) AS reward,
b.block_signature,
......@@ -63,9 +63,9 @@ class BlockController extends AbstractController
const BlockDetailsHeight = ' SELECT CAST(b.id AS UNSIGNED) AS id,
b.height,
bi.tx_count AS tx_count,
FORMAT(b.total_amount / 1000 000 00, 2) AS sent,
FORMAT(b.total_fee / 100 000 000, 2) AS tx_fee,
b.timestamp + 1407722400 AS unixtime,
b.total_amount AS sent,
b.total_fee AS tx_fee,
getUnixtime(b.timestamp) AS unixtime,
CAST(bi.generator_id AS UNSIGNED) AS forger,
af.name AS forger_name,
CAST(bi.recipient_id AS UNSIGNED) AS pool,
......@@ -117,7 +117,7 @@ class BlockController extends AbstractController
*/
public function blockDetails($block_id) {
$con = $this->entityManager->getConnection();
// TODO: Fix TX Count!!
$stmt = $con->prepare(self::BlockDetails);
$stmt->bindValue(1, $block_id);
$stmt->execute();
......
......@@ -15,8 +15,8 @@ class TransactionController extends AbstractController
const TransactionDetails = "SELECT t.height, t.type, t.subtype, t.version, t.full_hash, t.signature, t.amount, t.fee,
FALSE AS mo, FALSE AS mos, -- Will be set later in PHP
getTransactionType(t.type, t.subtype) AS type_name,
(t.timestamp + 1407722400) AS unixtime,
(t.block_timestamp + 1407722400) AS block_unixtime,
getUnixtime(t.timestamp) AS unixtime,
getUnixtime(t.block_timestamp) AS block_unixtime,
s.name AS sender_name,
r.name AS recipient_name,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
......@@ -45,37 +45,36 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(t.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
t.fee,
t.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) AS transaction_type
FROM transaction t
WHERE t.height = ?
UNION
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mo.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(mo.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
t.fee,
mo.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) AS transaction_type
FROM mo
JOIN transaction t ON (mo.db_id = t.db_id AND t.height = ?)
UNION
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mosr.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / mos.recipient_count / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
t.fee,
t.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) AS transaction_type
FROM mosr
JOIN mos ON (mos.db_id = mosr.db_id)
JOIN transaction t ON (mosr.db_id = t.db_id AND t.height = ?)
) as x
LEFT JOIN ec_account s ON (x.sender_id = s.id)
LEFT JOIN ec_account r ON (x.recipient_id = r.id)
WHERE x.recipient_id IS NOT NULL -- TransactionController/TransactionsByHeight";
LEFT JOIN ec_account r ON (x.recipient_id = r.id) -- TransactionController/TransactionsByHeight";
const TransactionsByBlockId = " SELECT x.id, x.sender_id, x.recipient_id, x.fee, x.amount, x.unixtime,
......@@ -84,9 +83,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(t.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
t.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
FROM transaction t
WHERE CAST(t.block_id AS UNSIGNED) = ?
......@@ -94,9 +93,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mo.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(mo.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
mo.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
FROM mo
JOIN transaction t ON (mo.db_id = t.db_id AND CAST(t.block_id AS UNSIGNED) = ?)
......@@ -104,17 +103,16 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mosr.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / mos.recipient_count / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee ,
t.amount / mos.recipient_count AS amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type
FROM mosr
JOIN mos ON (mos.db_id = mosr.db_id)
JOIN transaction t ON (mosr.db_id = t.db_id AND CAST(t.block_id AS UNSIGNED) = ?)
) as x
LEFT JOIN ec_account s ON (x.sender_id = s.id)
LEFT JOIN ec_account r ON (x.recipient_id = r.id)
WHERE x.recipient_id IS NOT NULL -- TransactionController/TransactionsByBlockId";
LEFT JOIN ec_account r ON (x.recipient_id = r.id) -- TransactionController/TransactionsByBlockId";
const TransactionByAccountId = "SELECT x.id, x.sender_id, x.recipient_id, x.fee, x.amount, x.unixtime,
x.transaction_type, x.block_id, x.height, s.name AS sender_name, r.name as recipient_name
......@@ -122,9 +120,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(t.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
t.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
t.height
......@@ -135,9 +133,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mo.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(mo.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
mo.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
t.height
......@@ -148,9 +146,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mo.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(mo.amount / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
mo.amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
t.height
......@@ -161,9 +159,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mosr.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / mos.recipient_count / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
t.amount / mos.recipient_count AS amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
t.height
......@@ -175,9 +173,9 @@ class TransactionController extends AbstractController
SELECT CAST(t.id AS UNSIGNED) AS id,
CAST(t.sender_id AS UNSIGNED) AS sender_id,
CAST(mosr.recipient_id AS UNSIGNED) AS recipient_id,
FORMAT(t.fee / 100000000, 2) AS fee,
FORMAT(t.amount / mos.recipient_count / 100000000, 2) AS amount,
t.timestamp + 1407722400 AS unixtime,
t.fee,
t.amount / mos.recipient_count AS amount,
getUnixtime(t.timestamp) AS unixtime,
getTransactionType(t.type, t.subtype) as transaction_type,
CAST(t.block_id AS UNSIGNED) as block_id,
t.height
......@@ -336,7 +334,7 @@ class TransactionController extends AbstractController
$stmt->bindValue(3, $id);
$stmt->execute();
$transactions = $stmt->fetchAll();
dump($transactions);
$Data = $this->paginationCalculator(count($transactions), $page);
$showTransactions = [];
......
......@@ -9,21 +9,21 @@
<tr><th>Account</th><td>{{ account.id | toRSAddress }}</td></tr>
<tr><th>Public Key</th><td>{{ account.public_key | str2bin }}</td></tr>
<tr><th>Name</th><td>{{ account.name }}</td></tr>
<tr><th>Balance</th><td>{{ account.balance }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Balance</th><td>{{ account.balance | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Recieved</th>
<td>
{{ ((account.burst_recieved + account.mo_recieved + account.mos_recieved) / 100000000) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }} in
{{ (account.burst_recieved + account.mo_recieved + account.mos_recieved) | planckToBurst }} {{ getEnv('RS_PREFIX') }} in
{{ account.tx_in_count }} transactions
</td>
</tr>
<tr><th>Sent</th><td>{{ account.burst_sent }} {{ getEnv('RS_PREFIX') }} in {{ account.tx_out_count }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid }} {{ getEnv('RS_PREFIX') }} paid</td></tr>
<tr><th>Pool Mined</th><td>{{ account.pool_mined_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% if account.is_pool %} }
<tr><th>Solo Mined</th><td>{{ (account.solo_mined_amount - account.rewarded_amount) | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Rewarded</th><td>{{ account.rewarded_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Sent</th><td>{{ account.burst_sent | planckToBurst }} {{ getEnv('RS_PREFIX') }} in {{ account.tx_out_count }} transactions</td></tr>
<tr><th>Transaction Fees</th><td>{{ account.fees_paid | planckToBurst }} {{ getEnv('RS_PREFIX') }} paid</td></tr>
<tr><th>Pool Mined</th><td>{{ account.pool_mined_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% if account.is_pool %}
<tr><th>Solo Mined</th><td>{{ (account.solo_mined_amount - account.rewarded_amount) | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Rewarded</th><td>{{ account.rewarded_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% else %}
<tr><th>Solo Mined</th><td>{{ account.solo_mined_amount | number_format(2, '.', ',') }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Solo Mined</th><td>{{ account.solo_mined_amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
{% endif %}
{% if account.pool_id is not null and account.pool_id != account.id %}
<tr><th>Pool</th>
......@@ -46,14 +46,26 @@
<div class="col-md-10">
<ul class="nav nav-tabs" id="accountTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ account.tx_total_count }})</a>
<a class="nav-link" id="tx-tab" data-toggle="tab" href="#tx" role="tab" aria-controls="tx" aria-selected="true">Transactions ({{ account.tx_total_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="forged-tab" data-toggle="tab" href="#forged" role="tab" aria-controls="forged" aria-selected="true">Forged Blocks ({{ account.forged_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="rewarded-tab" data-toggle="tab" href="#rewarded" role="tab" aria-controls="rewarded" aria-selected="true">Rewarded Blocks ({{ account.rewarded_count }})</a>
</li>
<li class="nav-item">
<a class="nav-link" id="asset-tab" data-toggle="tab" href="#asset" role="tab" aria-controls="asset" aria-selected="false">Asset Transfers</a>
</li>
</ul>
<div class="tab-content" id="accountTabContent">
<div class="tab-pane fade show active" id="tx" role="tabpanel" aria-labelledby="tx-tab">
<div class="tab-pane fade show active" id="forged" role="tabpanel" aria-labelledby="forged-tab">
<div class="include-html" id="forged-list" include-html="{{ url('account_details_forged', {'id': account.id }) }}">Loading....</div>
</div>
<div class="tab-pane fade show" id="rewarded" role="tabpanel" aria-labelledby="rewarded-tab">
<div class="include-html" id="rewarded-list" include-html="{{ url('account_details_rewarded', {'id': account.id }) }}">Loading....</div>
</div>
<div class="tab-pane fade show" id="tx" role="tabpanel" aria-labelledby="tx-tab">
<div class="include-html" id="tx-list" include-html="{{ url('transactions_by_accountId', {'id': account.id }) }}">Loading.... <small>large amounts of Transactions may take up to 20s</small></div>
</div>
<div class="tab-pane fade" id="asset" role="tabpanel" aria-labelledby="asset-tab">Asset, to be done</div>
......
......@@ -8,8 +8,8 @@
<table class="table table-striped table-hover table-sm">
<tr><th>Height</th><td>{{ block.height }}</td></tr>
<tr><th>Number of Transactions</th><td>{{ block.tx_count }}</td></tr>
<tr><th>Total Amount sent</th><td>{{ block.sent }}</td></tr>
<tr><th>Transaction Fees</th><td>{{ block.tx_fee }}</td></tr>
<tr><th>Total Amount sent</th><td>{{ block.sent | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Transaction Fees</th><td>{{ block.tx_fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td></tr>
<tr><th>Timestamp</th><td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td></tr>
<tr><th>Forger</th>
<td>
......
......@@ -46,8 +46,8 @@
<tr>
<td><a href="{{ path('block_details', {'block_id': block.id}) }}">{{ block.height }}</a></td>
<td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td>
<td>{{ block.reward }} + {{ block.tx_fee }}</td>
<td>{{ block.sent }}</td>
<td>{{ block.reward }} + {{ block.tx_fee | planckToBurst }}</td>
<td>{{ block.sent | planckToBurst }}</td>
<td>{{ block.tx_count }}</td>
<td>
{% if block.pool == block.forger %}
......
<ul class="pagination">
{% if 0 not in pageLinks %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': 0, 'id': id }) }}')">1</a></li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
{% endif %}
{% if current_page != 0 %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': current_page - 1, 'id': id }) }}')">&laquo;</a></li>
{% endif %}
{% for pageLink in pageLinks %}
{% if pageLink != current_page %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': pageLink, 'id': id }) }}')">{{ pageLink + 1 }}</a></li>
{% else %}
<li class="page-item active"><span class="page-link">{{ pageLink + 1 }}</span></li>
{% endif %}
{% endfor %}
{% if current_page != last_page %}
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': current_page + 1, 'id': id }) }}')">&raquo;</a></li>
<li class="page-item"><span class="page-link">&nbsp;</span></li>
<li class="page-item"><a class="page-link" href="#" onclick="nextPage('{{ list_name }}', '{{ path(route, {'page': last_page, 'id': id }) }}')">{{ last_page + 1 }}</a></li>
{% endif %}
</ul>
<table class="table table-striped table-bordered table-hover table-sm">
<thead>
<th style="position: sticky; top: 0; background-color: white;">Height</th>
<th style="position: sticky; top: 0; background-color: white;">Timestamp</th>
<th style="position: sticky; top: 0; background-color: white;">Reward</th>
<th style="position: sticky; top: 0; background-color: white;">Sent</th>
<th style="position: sticky; top: 0; background-color: white;">#TXs</th>
{% if forged %}<th style="position: sticky; top: 0; background-color: white;">Pool</th>{% else %}
<th style="position: sticky; top: 0; background-color: white;">Forger</th>{% endif %}
</thead>
<tbody>
{% for block in blocks %}
<tr>
<td><a href="{{ path('block_details', {'block_id': block.id}) }}">{{ block.height }}</a></td>
<td>{{ block.unixtime | date ("Y-m-d H:i:s", "Europe/Berlin") }}</td>
<td>{{ block.reward }} + {{ block.tx_fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ block.sent | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ block.tx_count }}</td>
{% if forged %}
<td>
{% if block.pool == block.forger %}
<span style="color: orangered;">( Solo )</span>
{% else %}
<a href="{{ path('account_details', {id: block.pool |toAccountId }) }}">
{% if block.pool_name is not null%}
{{ block.pool_name }}
{% else %}
{{ block.pool | toRSAddress }}
{% endif %}
</a>
{% endif %}
</td>
{% else %}
<td><a href="{{ path('account_details', {id: block.forger | toAccountId }) }}">
{% if block.forger_name is not null %}
{{ block.forger_name }}
{% else %}
{{ block.forger | toRSAddress }}
{% endif %}
</a></td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
\ No newline at end of file
......@@ -31,7 +31,7 @@
</tr>
{% endfor %}
</table>
{% else %}
{% elseif transaction.recipient_id is not null %}
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
......
......@@ -66,12 +66,10 @@
<a href="{{ path('account_details', {id: transaction.recipient_id | toAccountId }) }}">
{{ transaction.recipient_id | toRSAddress }}<br />{{ transaction.recipient_name }}
</a>
{% else %}
Multiple Recipients, <a href="{{ path('transaction_details', {'id': transaction.id}) }}">Details</a>
{% endif %}
</td>
<td>{{ transaction.amount }}</td>
<td>{{ transaction.fee }}</td>
<td>{{ transaction.amount | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
<td>{{ transaction.fee | planckToBurst }} {{ getEnv('RS_PREFIX') }}</td>
{% if route != "transactions_by_height" and route != "transactions_by_blockId" %}
<td><a href="{{ url('block_details', {'block_id': transaction.block_id}) }}">#{{ transaction.height }}</a></td>
{% endif %}
......