@crtxio/abi
Version:
A tiny Solidity ABI encoder and decoder
16 lines (15 loc) • 562 B
TypeScript
/**
* Get a bigint from a two's complement encoded buffer or hexadecimal string.
*
* @param buffer The buffer to get the number for.
* @return The parsed number.
*/
export declare const fromTwosComplement: (buffer: string | Uint8Array) => bigint;
/**
* Get a two's complement encoded buffer from a bigint.
*
* @param value The number to get the buffer for.
* @param length The number of bytes to pad the buffer to.
* @return The two's complement encoded buffer.
*/
export declare const toTwosComplement: (value: bigint, length: number) => Uint8Array;