UNPKG

@dappykit/sdk

Version:

Web3 SDK for DApps

21 lines (20 loc) 775 B
export interface Bytes<Length extends number> extends Uint8Array { readonly length: Length; } /** * Checks if the given value is a valid Bytes of the given length. * @param b Data to check * @param length Length of the Bytes */ export declare function isBytes<Length extends number>(b: unknown, length: Length): b is Bytes<Length>; /** * Asserts that the given value is a valid Bytes of the given length. * @param b Data to check * @param length Length of the Bytes */ export declare function assertBytes<Length extends number>(b: unknown, length: Length): asserts b is Bytes<Length>; /** * Creates a new Bytes of the given length. * @param length Length of the Bytes */ export declare function makeBytes<Length extends number>(length: Length): Bytes<Length>;