Add PACS.002 listener, CAMT.054 listener, ULL tracker - ISO 20022 full loop

This commit is contained in:
VZ Build
2026-07-15 03:15:38 +00:00
parent 6c38390461
commit a30a78051b
4 changed files with 864 additions and 0 deletions

View File

@@ -22,6 +22,15 @@ from koreid import KoreIDGenerator, KoreIDParser, KoreType, KoreDomain, GENESIS_
from eventbus import EventBusClient, Severity, EventType
from lick import build_headers, canonicalize
# Import ISO 20022 trackers (fail gracefully if not available)
try:
from pacs002_listener import register_pending as pacs002_register
from ull_tracker import register_transaction as ull_register
ISO20022_TRACKING = True
except ImportError:
ISO20022_TRACKING = False
log.warning("ISO 20022 trackers not available — PACS.002/ULL tracking disabled")
urllib3.disable_warnings()
logging.basicConfig(level=logging.INFO, format='%(asctime)s [POLLER-V3] %(levelname)s %(message)s')
log = logging.getLogger(__name__)
@@ -29,6 +38,7 @@ log = logging.getLogger(__name__)
# ── Config ────────────────────────────────────────────────────────────────────
API_PRIMARY = os.environ.get('KORENET_API_URL', 'https://korechain.korenet.cloud')
API_ISO20022 = os.environ.get('KORENET_API_URL_FULL', 'https://api.korenet.cloud') # PACS/CAMT/ULL
API_FALLBACK = os.environ.get('KORENET_API_FALLBACK', 'https://fnb.korenet.cloud')
RAILS_URL = os.environ.get('VECTOR_ZULU_RAILS_URL', 'https://vector.korenet.cloud')
BENJII_URL = 'https://benjii-prime.korenet.cloud'
@@ -212,6 +222,18 @@ def sanctions_check(jwt: str, entity: str, jurisdiction: str = 'GLOBAL') -> bool
# ── Mirror lifecycle ──────────────────────────────────────────────────────────
def register_iso20022(r, uetr: str, koreid: str, amount: float, currency: str):
"""Register transaction with PACS.002 and ULL trackers."""
if not ISO20022_TRACKING:
return
try:
pacs002_register(r, uetr, koreid, amount, currency, f'VZ-{koreid}')
ull_register(r, uetr, koreid, amount, currency)
log.info(f"Registered {uetr} for PACS.002 + ULL tracking")
except Exception as e:
log.error(f"ISO 20022 registration error: {e}")
def mirror_mint(jwt: str, uetr: str, asset: str, amount: float,
rail_ref: str, vault: str) -> dict:
log.info(f"MINT {amount} {asset} UETR:{uetr}")