diff --git a/apps/blockchain-explorer/main.py b/apps/blockchain-explorer/main.py index 3067fa97..9f0a5484 100755 --- a/apps/blockchain-explorer/main.py +++ b/apps/blockchain-explorer/main.py @@ -11,7 +11,7 @@ import csv import io from datetime import datetime, timedelta from typing import Dict, List, Optional, Any, Union -from fastapi import FastAPI, Request, HTTPException, Query, Response +from fastapi import FastAPI, HTTPException, Request, Query, Response from fastapi.responses import HTMLResponse, StreamingResponse from fastapi.staticfiles import StaticFiles from pydantic import BaseModel, Field @@ -628,11 +628,11 @@ HTML_TEMPLATE = r""" ${results.map(tx => ` - ${tx.hash || '-'} - ${tx.type || '-'} - ${tx.from || '-'} - ${tx.to || '-'} - ${tx.amount || '0'} + ${tx.tx_hash || '-'} + ${tx.payload?.type || '-'} + ${tx.sender || '-'} + ${tx.recipient || '-'} + ${tx.payload?.amount ?? tx.payload?.value ?? '0'} ${formatTimestamp(tx.timestamp)} `).join('')} @@ -677,27 +677,27 @@ HTML_TEMPLATE = r"""
Hash: - ${tx.hash || '-'} + ${tx.tx_hash || '-'}
Type: - ${tx.type || '-'} + ${tx.payload?.type || '-'}
From: - ${tx.from || '-'} + ${tx.sender || '-'}
To: - ${tx.to || '-'} + ${tx.recipient || '-'}
Amount: - ${tx.amount || '0'} + ${tx.payload?.amount ?? tx.payload?.value ?? '0'}
Fee: - ${tx.fee || '0'} + ${tx.payload?.fee ?? '0'}
Timestamp: @@ -842,7 +842,7 @@ HTML_TEMPLATE = r""" alert('Export failed. Please try again.'); } } - ${tx.fee || '0'} + ${tx.payload?.fee ?? '0'}
Block: