UNPKG

@zlattice/lattice-js

Version:

Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)

27 lines 1.03 kB
/** * About bytes32 strings... * * @_docloc: api/utils:Bytes32 Strings */ import type { BytesLike } from "@ethersproject/bytes"; /** * Encodes %%text%% as a Bytes32 string. */ export declare function encodeBytes32String(text: string): string; /** * Encodes the Bytes32-encoded %%bytes%% into a string. */ export declare function decodeBytes32String(_bytes: BytesLike): string; /** * Encodes a Buffer into an array of Bytes32 strings. */ export declare function encodeBytes32Array(bytes: Buffer): string[]; export declare function decodeBytes32Array(bytes: string[]): Buffer[]; /** * Convert an array of hex strings to a buffer with trimmed zeros. * For example: ["0x1234567890abcdef", "0xabcdef1234567890"] -> Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]) * @param hexStrings - An array of hex strings. * @returns A buffer containing the concatenated hex strings. */ export declare function hexStringsToBufferWithTrimmedZeros(hexStrings: string[]): Buffer; //# sourceMappingURL=bytes32.d.ts.map