ethers.js/packages/bytes/lib/index.d.ts

42 lines
1.8 KiB
TypeScript
Raw Permalink Normal View History

2019-05-14 18:48:48 -04:00
export declare type Bytes = ArrayLike<number>;
export declare type BytesLike = Bytes | string;
export declare type DataOptions = {
allowMissingPrefix?: boolean;
2019-09-28 02:36:19 -04:00
hexPad?: "left" | "right" | null;
2019-05-14 18:48:48 -04:00
};
export interface Hexable {
toHexString(): string;
}
export declare type SignatureLike = {
r: string;
s?: string;
_vs?: string;
recoveryParam?: number;
v?: number;
} | BytesLike;
export interface Signature {
r: string;
s: string;
_vs: string;
recoveryParam: number;
v: number;
2022-03-09 02:56:08 -05:00
yParityAndS: string;
compact: string;
2019-05-14 18:48:48 -04:00
}
export declare function isBytesLike(value: any): value is BytesLike;
export declare function isBytes(value: any): value is Bytes;
export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array;
2021-03-30 15:22:45 -04:00
export declare function concat(items: ReadonlyArray<BytesLike>): Uint8Array;
2019-05-14 18:48:48 -04:00
export declare function stripZeros(value: BytesLike): Uint8Array;
export declare function zeroPad(value: BytesLike, length: number): Uint8Array;
export declare function isHexString(value: any, length?: number): boolean;
2021-05-17 16:19:36 -04:00
export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string;
2019-05-14 18:48:48 -04:00
export declare function hexDataLength(data: BytesLike): number;
export declare function hexDataSlice(data: BytesLike, offset: number, endOffset?: number): string;
2021-03-30 15:22:45 -04:00
export declare function hexConcat(items: ReadonlyArray<BytesLike>): string;
2021-05-17 16:19:36 -04:00
export declare function hexValue(value: BytesLike | Hexable | number | bigint): string;
2019-05-14 18:48:48 -04:00
export declare function hexStripZeros(value: BytesLike): string;
export declare function hexZeroPad(value: BytesLike, length: number): string;
export declare function splitSignature(signature: SignatureLike): Signature;
2020-01-10 03:19:21 -05:00
export declare function joinSignature(signature: SignatureLike): string;
//# sourceMappingURL=index.d.ts.map