{% extends "wallet/components/wallet_tab.jinja" %}
{% set tab = 'wallet_tx' %}
{% block content %}
	{% from 'wallet/history/components/total_wallet_balances.jinja' import total_wallet_balances %}
	{{ total_wallet_balances(wallet, specter) }}
	{% if wallet.utxo|length > 0 %}
		<div style="padding: 0 30px; width: 100%;">
				{% from 'wallet/history/components/history_nav.jinja' import history_nav %}
				{{ history_nav('history', wallet_alias, viewtype) }}
		</div><br>
	{% endif %}
	{% set validate_merkle_proofs=specter.config.validate_merkle_proofs %}
	{% set transactions = wallet.txlist(idx, validate_merkle_proofs=validate_merkle_proofs) %}
	{% set next_transactions = wallet.txlist(idx + 1, validate_merkle_proofs=validate_merkle_proofs) %}
	{% if idx != 0 or next_transactions|length != 0 %}
		<div>
			<a href="./?idx={{ idx - 1 }}" class="pagination-arrow {% if idx == 0 %}pagination-disabled{% endif %}">&#8249;</a>
			{% if next_transactions|length > 0 or idx != 0 %}
			Page {{ idx + 1 }}
			{% endif %}
			<a href="./?idx={{ idx + 1 }}" class="pagination-arrow {% if next_transactions|length == 0 %}pagination-disabled{% endif %}">&#8250;</a>
		</div>
	{% endif %}
	<div class="table-holder">
		{% from 'wallet/history/components/tx_table.jinja' import tx_table %}
		{% from 'wallet/history/txs/components/full_tx_table.jinja' import full_tx_table %}
		{{
			tx_table(
				transactions == [],
				full_tx_table(transactions=transactions, wallet=wallet, specter=specter, includeValidatedBlockhash=validate_merkle_proofs),
				includeValidatedBlockhash=validate_merkle_proofs,
			)
		}}
	</div>
{% endblock %}
