feat: scaffold deterministic replayable indexer architecture with core pipeline, models and docker
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Dict, Any, Optional
|
||||
|
||||
class NormalizedEvent(BaseModel):
|
||||
"""跨链与跨合约的标准归一化事件 (Layer 2)"""
|
||||
chain_id: int
|
||||
block_number: int
|
||||
tx_hash: str
|
||||
log_index: int
|
||||
event_type: str = Field(description="e.g. MARKET_CREATED, MINT_COLLATERAL, REDEEM_OT, RESOLVE_OUTCOME, CLAIM")
|
||||
contract_address: str
|
||||
payload: Dict[str, Any]
|
||||
timestamp: int
|
||||
|
||||
@property
|
||||
def event_id(self) -> str:
|
||||
"""全局唯一幂等标识 (Idempotency Key)"""
|
||||
return f"{self.chain_id}:{self.tx_hash}:{self.log_index}"
|
||||
Reference in New Issue
Block a user