import { Hex } from 'ox'; import * as Store from './Store.js'; /** * Whether a `TransferWithMemo` memo is an MPP attribution memo: a full 32-byte * value prefixed with the {@link attributionTag}. */ export declare function isAttributionMemo(memo: Hex.Hex): boolean; /** * Extracts the 10-byte MPP server fingerprint from an attribution memo, or * undefined when the memo is not an attribution memo. The fingerprint occupies * bytes 5–14 (after the 4-byte tag and a 1-byte version), matching the * `0x`-prefixed lowercase hex keys produced by {@link fingerprintForRealm}. */ export declare function extractFingerprint(memo: Hex.Hex): string | undefined; /** * Computes the MPP server fingerprint for a service realm: the first 10 bytes * of `keccak256(realm)`, lowercased. The directory and the memo agree on this * derivation, so a memo fingerprint can be matched against the directory map. */ export declare function fingerprintForRealm(realm: string): string; /** * Resolves the service display name for a transfer from its attribution memo: * the live directory entry for the memo's fingerprint, falling back to the * generic `MPP Service` label when the memo is an attribution memo whose * fingerprint is not (yet) in the directory. Returns undefined when there is no * attribution memo (e.g. inbound transfers reconstructed without log data, or * plain non-MPP transfers). */ export declare function resolve(options: resolve.Options): string | undefined; export declare namespace resolve { /** Options for {@link resolve}. */ type Options = { /** Fingerprint → service-name directory map, when available. */ fingerprintMap?: Record | undefined; /** Raw `TransferWithMemo` memo, when the transfer carried one. */ memo?: Hex.Hex | undefined; }; } /** * Fetches and memoizes the live MPP directory as a fingerprint → service-name * map, so attribution memos can be resolved to current service names. The fetch * is bounded by a short timeout; only successful results are cached (failures * propagate so the next call retries rather than caching an empty map). */ export declare function fingerprintMap(options: fingerprintMap.Options): Promise>; export declare namespace fingerprintMap { /** Options for {@link fingerprintMap}. */ type Options = { /** Cache store for directory memoization. */ store: Store.Store; /** Cache TTL in milliseconds (defaults to 10 minutes). */ ttl?: number | undefined; /** Override for the directory endpoint (defaults to the live MPP directory). */ url?: string | undefined; }; /** Shape of the MPP directory response. */ type Directory = { services: readonly { id: string; name: string; realm?: string | undefined; }[]; }; } /** Thrown when the MPP directory endpoint returns a non-2xx status. */ export declare class UpstreamError extends Error { /** The HTTP status returned by the directory endpoint. */ status: number; constructor(status: number); } //# sourceMappingURL=Mpp.d.ts.map