/** * Block-explorer links, built only from a hash or address that has been * checked first. * * Apps used to concatenate `explorer + '/tx/' + hash` from whatever string * they held — a value off a receipt, a query parameter, a backend field. A * string that is not a hash then becomes a link that points somewhere else * (`/tx/../../evil`, `?x=`, a whole other URL). These helpers refuse anything * that is not exactly a 32-byte hash or a 20-byte address, and refuse a base * that is not an `https://` origin, so the only URL they can return is * `/tx/` or `/address/
`. * * A URL is a locator, not copy — no words, no locale — so it does not * stretch the domain layer's "numbers and codes only" rule. * * Pure: no network, no environment. They take any object with a * `blockExplorerUrl` — a `CHAIN_CONFIGS` entry, or a custom one. */ /** The one field these helpers read from a chain config. */ export interface ExplorerConfig { blockExplorerUrl: string; } /** * `/tx/`. Throws unless `txHash` is exactly `0x` * followed by 64 hex digits. */ export declare function explorerTxUrl(config: ExplorerConfig, txHash: string): string; /** * `/address/
`, the address as given. Throws unless * `address` is `0x` followed by 40 hex digits with a valid checksum when it * is mixed-case (all-lower and all-upper carry no checksum and are accepted). */ export declare function explorerAddressUrl(config: ExplorerConfig, address: string): string;