2026-01-06 01:46:25 -08:00
|
|
|
#!/usr/bin/env bash
|
2026-02-12 15:46:57 -08:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
2026-01-06 01:46:25 -08:00
|
|
|
# Transaction logging utilities
|
|
|
|
|
|
|
|
|
|
LOG_DIR="${LOG_DIR:-/home/intlc/projects/proxmox/logs}"
|
|
|
|
|
LOG_FILE="$LOG_DIR/bridge-transactions-$(date +%Y%m%d).log"
|
|
|
|
|
|
|
|
|
|
log_transaction() {
|
|
|
|
|
local tx_hash="$1"
|
|
|
|
|
local chain="$2"
|
|
|
|
|
local amount="$3"
|
|
|
|
|
local status="$4"
|
|
|
|
|
|
|
|
|
|
echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] $status | $chain | $amount | $tx_hash" >> "$LOG_FILE"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get_transaction_status() {
|
|
|
|
|
local tx_hash="$1"
|
|
|
|
|
local rpc_url="$2"
|
|
|
|
|
cast tx "$tx_hash" --rpc-url "$rpc_url" 2>/dev/null | grep -E "status|blockNumber" || echo "Pending"
|
|
|
|
|
}
|