UNPKG

@unruggable/gateways

Version:

Trustless Ethereum Multichain CCIP-Read Gateway

38 lines 1.54 kB
import { type RollupCommitType, type Rollup } from './rollup.js'; import type { HexString } from './types.js'; import { CachedMap, CachedValue, LRU } from './cached.js'; import { GatewayRequestV1 } from './v1.js'; import { EZCCIP } from '@namestone/ezccip'; export declare const GATEWAY_ABI: any; type CachedCommit<R extends Rollup> = { commit: RollupCommitType<R>; valid: CachedValue<boolean>; parent: CachedValue<bigint>; }; export declare class Gateway<R extends Rollup> extends EZCCIP { readonly rollup: R; commitDepth: number; allowHistorical: boolean; readonly latestCache: CachedValue<bigint>; readonly commitCacheMap: CachedMap<bigint, CachedCommit<R>>; readonly callLRU: LRU<string, Uint8Array>; constructor(rollup: R); private _updateLatest; getLatestCommit(): Promise<RollupCommitType<R>>; getParentCommit(commit: RollupCommitType<R>): Promise<RollupCommitType<R>>; getRecentCommit(index: bigint): Promise<RollupCommitType<R>>; private cachedCommit; disableCache(): void; } export declare abstract class GatewayV1<R extends Rollup> extends EZCCIP { readonly rollup: R; private latestCommit; readonly latestCache: CachedValue<RollupCommitType<R>>; readonly callLRU: LRU<string, Uint8Array>; constructor(rollup: R); getLatestCommit(): Promise<RollupCommitType<R>>; disableCache(): void; abstract handleRequest(commit: RollupCommitType<R>, request: GatewayRequestV1): Promise<HexString>; } export {}; //# sourceMappingURL=gateway.d.ts.map