2019-01-04 10:33:02 +01:00
|
|
|
export declare function readUInt64LE(buffer: Buffer, offset: number): number;
|
|
|
|
export declare function writeUInt64LE(buffer: Buffer, value: number, offset: number): number;
|
|
|
|
export declare function reverseBuffer(buffer: Buffer): Buffer;
|
2020-04-26 10:22:38 +02:00
|
|
|
export declare function cloneBuffer(buffer: Buffer): Buffer;
|
2020-01-15 02:44:29 +01:00
|
|
|
/**
|
|
|
|
* Helper class for serialization of bitcoin data types into a pre-allocated buffer.
|
|
|
|
*/
|
|
|
|
export declare class BufferWriter {
|
2020-01-15 02:50:33 +01:00
|
|
|
buffer: Buffer;
|
2020-01-15 02:44:29 +01:00
|
|
|
offset: number;
|
|
|
|
constructor(buffer: Buffer, offset?: number);
|
|
|
|
writeUInt8(i: number): void;
|
|
|
|
writeInt32(i: number): void;
|
|
|
|
writeUInt32(i: number): void;
|
|
|
|
writeUInt64(i: number): void;
|
|
|
|
writeVarInt(i: number): void;
|
|
|
|
writeSlice(slice: Buffer): void;
|
|
|
|
writeVarSlice(slice: Buffer): void;
|
|
|
|
writeVector(vector: Buffer[]): void;
|
|
|
|
}
|
|
|
|
/**
|
2020-01-15 03:28:56 +01:00
|
|
|
* Helper class for reading of bitcoin data types from a buffer.
|
2020-01-15 02:44:29 +01:00
|
|
|
*/
|
|
|
|
export declare class BufferReader {
|
2020-01-15 02:50:33 +01:00
|
|
|
buffer: Buffer;
|
2020-01-15 02:44:29 +01:00
|
|
|
offset: number;
|
|
|
|
constructor(buffer: Buffer, offset?: number);
|
|
|
|
readUInt8(): number;
|
|
|
|
readInt32(): number;
|
|
|
|
readUInt32(): number;
|
|
|
|
readUInt64(): number;
|
|
|
|
readVarInt(): number;
|
|
|
|
readSlice(n: number): Buffer;
|
|
|
|
readVarSlice(): Buffer;
|
|
|
|
readVector(): Buffer[];
|
|
|
|
}
|