UNPKG

501 BTypeScriptView Raw
1import type { HexString } from '../types.js';
2/**
3 * @name hexAddPrefix
4 * @summary Adds the `0x` prefix to string values.
5 * @description
6 * Returns a `0x` prefixed string from the input value. If the input is already prefixed, it is returned unchanged.
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { hexAddPrefix } from '@polkadot/util';
12 *
13 * console.log('With prefix', hexAddPrefix('0a0b12')); // => 0x0a0b12
14 * ```
15 */
16export declare function hexAddPrefix(value?: string | null): HexString;