Files
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

53 lines
2.3 KiB
TypeScript

/** Transfer-time USD for Chain 138 checkpoint leaves (off-chain metadata only). */
export declare const CHAIN138_NATIVE_PRICING_ADDRESS = "0xc02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
/** Canonical Chain 138 stables — $1 peg when price-at API is unavailable. */
export declare const CHAIN138_STABLE_USD_PEG: Record<string, number>;
/** Known Chain 138 assets (override via env CHECKPOINT_USD_PEG_<SYMBOL>). */
export declare const CHAIN138_KNOWN_TOKEN_USD: Record<string, number>;
export type HistoricalPriceSnapshot = {
chainId: number;
tokenAddress: string;
requestedTimestamp: string;
effectiveTimestamp: string;
priceUsd: number;
source: string;
};
export type TransferUsdLine = {
kind: 'native' | 'erc20';
token?: string;
tokenSymbol?: string;
tokenDecimals?: number;
from?: string;
to?: string;
amountRaw: string;
logIndex?: number;
priceUsd?: number;
priceSource?: string;
priceEffectiveTimestamp?: string;
valueUsd?: string;
};
/** Convert decimal USD string (e.g. batch JSON) to 8-decimal fixed point for on-chain events. */
export declare function usdStringToE8(usd: string | undefined | null): bigint;
export type UsdPricingConfig = {
apiBaseUrl: string;
chainId?: number;
enabled?: boolean;
requestDelayMs?: number;
};
/** USD string with `outputScale` fractional digits (default 6). */
export declare function formatAmountUsd(rawAmount: string, decimals: number, priceUsd: number, priceScale?: number, outputScale?: number): string | undefined;
export declare function blockTimestampToIso(blockTimestamp: number): string;
export declare function fetchHistoricalPriceUsd(cfg: UsdPricingConfig, tokenAddress: string, blockTimestamp: number): Promise<HistoricalPriceSnapshot | null>;
export declare function priceTransferLine(cfg: UsdPricingConfig, line: TransferUsdLine, blockTimestamp: number): Promise<TransferUsdLine>;
/** Sum USD strings (6 decimal places) without floating-point drift. */
export declare function sumUsdStrings(values: (string | undefined)[]): string | undefined;
export declare function enrichLeafUsdFields(cfg: UsdPricingConfig, leaf: Record<string, unknown>, allErc20: Array<{
token: string;
tokenSymbol: string;
tokenDecimals: number;
from: string;
to: string;
value: bigint;
logIndex: number;
}>): Promise<Record<string, unknown>>;