Files
smom-dbis-138/services/checkpoint-indexer/src/iso20022LogDecode.ts
defiQUG c336809676
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m3s
CI/CD Pipeline / Security Scanning (push) Successful in 2m18s
CI/CD Pipeline / Lint and Format (push) Failing after 34s
CI/CD Pipeline / Terraform Validation (push) Failing after 20s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 22s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 40s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 49s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 21s
Validation / validate-genesis (push) Successful in 25s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 8s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m11s
Validation / validate-documentation (push) Failing after 14s
Verify Deployment / Verify Deployment (push) Failing after 45s
Add mainnet checkpoint stack: ISO attestation, participant Etherscan surface, and services.
Ship AddressActivityRegistry V1/V2, ISO20022IntakeGateway, Chain138ParticipantSurface,
checkpoint hub contracts, checkpoint-core package, aggregator/indexer/sdk services,
relay profile guards, M00 diamond bridge facet, and OMNL compliance contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 00:30:45 -07:00

56 lines
1.7 KiB
TypeScript

import { ethers } from 'ethers';
import { chain138ExplorerTxUrl, chain138TxHashFromLogTopic } from './chain138Explorer';
export type DecodedIsoAttestationLog = {
chain138TxHash: string;
chain138ExplorerUrl: string;
instructionId: string;
uetr: string;
creditor: string;
debtor: string;
mainnetTxHash: string;
mainnetExplorerUrl: string;
blockNumber: string;
logIndex: string;
};
type EtherscanLogRow = {
topics?: string[];
transactionHash?: string;
blockNumber?: string;
logIndex?: string;
};
/** topic0 = PaymentAttested(bytes32,bytes32,address,address,bytes32,...) — matches cast sig-event */
export const PAYMENT_ATTESTED_TOPIC0 =
'0x827a09f9798dc544d2acc52ecdad1fe0f5fa859be89a74a39dd7cb986b4cb340';
export function decodePaymentAttestedLogs(
envelope: { status: string; result: EtherscanLogRow[] },
explorerBase?: string
): DecodedIsoAttestationLog[] {
if (envelope.status !== '1' || !Array.isArray(envelope.result)) return [];
const out: DecodedIsoAttestationLog[] = [];
for (const log of envelope.result) {
const t = log.topics ?? [];
if (t.length < 4 || !log.transactionHash) continue;
const chain138TxHash = chain138TxHashFromLogTopic(t[1]);
if (!chain138TxHash) continue;
const instructionId = t[2] ?? '';
const creditor = t[3] ? ethers.getAddress('0x' + t[3].slice(-40)) : '';
out.push({
chain138TxHash,
chain138ExplorerUrl: chain138ExplorerTxUrl(chain138TxHash, explorerBase),
instructionId,
uetr: '',
creditor,
debtor: '',
mainnetTxHash: log.transactionHash,
mainnetExplorerUrl: `https://etherscan.io/tx/${log.transactionHash}`,
blockNumber: String(log.blockNumber ?? ''),
logIndex: String(log.logIndex ?? ''),
});
}
return out;
}