Files
proxmox/multi-chain-execution/src/audit/audit-store.ts
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

48 lines
1.2 KiB
TypeScript

/**
* Audit store for Chain138->Tezos USDtz executions.
* Stores pre-trade quotes, tx hashes per hop, bridge message IDs, final delivered amount.
*/
export interface ExecutionAudit {
intent_id: string;
execution_id: string;
route_id?: string;
created_at: string;
status: 'planned' | 'quoted' | 'executing' | 'completed' | 'failed';
pre_trade_quote?: {
amount_in: string;
expected_out: string;
fees: string;
quoted_at: string;
};
hops: Array<{
step_index: number;
chain_id: number;
action: string;
tx_hash?: string;
block_number?: string;
bridge_message_id?: string;
status: string;
}>;
final_delivered?: {
amount: string;
asset: string;
destination: string;
tx_hash?: string;
};
}
const store = new Map<string, ExecutionAudit>();
export function recordAudit(audit: ExecutionAudit): void {
store.set(audit.execution_id, audit);
}
export function getAudit(executionId: string): ExecutionAudit | undefined {
return store.get(executionId);
}
export function getAuditsByIntent(intentId: string): ExecutionAudit[] {
return Array.from(store.values()).filter((a) => a.intent_id === intentId);
}