@bsv/overlay-express
Version:
BSV Blockchain Overlay Express
31 lines • 1.65 kB
TypeScript
import { LookupService, LookupFormula, AdmissionMode, SpendNotificationMode, OutputAdmittedByTopic, OutputSpent, LookupServiceMetaData } from '@bsv/overlay';
import { LookupQuestion } from '@bsv/sdk';
import { BanService } from './BanService.js';
/**
* Wraps a SHIP or SLAP LookupService to intercept outputAdmittedByTopic calls
* and block outputs whose domain or outpoint appears in the persistent ban list.
*
* This prevents GASP from re-syncing stale or banned tokens that were previously
* removed by the Janitor or an admin.
*/
export declare class BanAwareLookupWrapper implements LookupService {
private readonly wrapped;
private readonly banService;
private readonly protocol;
private readonly logger;
readonly admissionMode: AdmissionMode;
readonly spendNotificationMode: SpendNotificationMode;
constructor(wrapped: LookupService, banService: BanService, protocol: 'SHIP' | 'SLAP', logger?: typeof console);
/**
* Intercepts admission to check the ban list before delegating to the wrapped service.
* If the output's domain or outpoint is banned, the admission is silently blocked.
*/
outputAdmittedByTopic(payload: OutputAdmittedByTopic): Promise<void>;
outputSpent(payload: OutputSpent): Promise<void>;
outputNoLongerRetainedInHistory(txid: string, outputIndex: number, topic: string): Promise<void>;
outputEvicted(txid: string, outputIndex: number): Promise<void>;
lookup(question: LookupQuestion): Promise<LookupFormula>;
getDocumentation(): Promise<string>;
getMetaData(): Promise<LookupServiceMetaData>;
}
//# sourceMappingURL=BanAwareLookupWrapper.d.ts.map