@swtc/serializer
Version:
swtc serializer
146 lines • 3.98 kB
TypeScript
declare const Factory: (Wallet?: any) => {
new (buf: any): {
buffer: number[];
pointer: number;
/**
* read content and move pointer
*
* @memberof Serializer
*/
read(bytes: any): number[];
/**
* read content but not move pointer
*
* @memberof Serializer
*/
peek(bytes: any): number[];
/**
* Convert the byte array to HEX values as String
* Input is 32-bits(byte) array
* Output is String with ordered sequence of 16-bit values contains only 0-9 and A-F
*
* @memberof Serializer
*/
bytes_to_str(in_buf: any): string;
/**
* Append the input bytes array to the internal buffer and set the pointer to the end.
*
* @memberof Serializer
*/
append(bytes: any): void;
resetPointer(): void;
/**
* Convert the byte array to HEX values
*
* @memberof Serializer
*/
to_hex(): string;
/**
* Convert the byte array to JSON format
*
* @memberof Serializer
*/
to_json(): {};
/**
* Serialize the object
*
* @memberof Serializer
*/
serialize(obj: any): void;
/**
* Hash data using SHA-512 and return the first 256 bits in HEX string format.
*
* @memberof Serializer
*/
hash(prefix: any): string;
};
TypeUtils: any;
/**
* convert the input JSON to a byte array as buffer
*
* @static
* @memberof Serializer
*/
from_json(o: any): {
buffer: number[];
pointer: number;
/**
* read content and move pointer
*
* @memberof Serializer
*/
read(bytes: any): number[];
/**
* read content but not move pointer
*
* @memberof Serializer
*/
peek(bytes: any): number[];
/**
* Convert the byte array to HEX values as String
* Input is 32-bits(byte) array
* Output is String with ordered sequence of 16-bit values contains only 0-9 and A-F
*
* @memberof Serializer
*/
bytes_to_str(in_buf: any): string;
/**
* Append the input bytes array to the internal buffer and set the pointer to the end.
*
* @memberof Serializer
*/
append(bytes: any): void;
resetPointer(): void;
/**
* Convert the byte array to HEX values
*
* @memberof Serializer
*/
to_hex(): string;
/**
* Convert the byte array to JSON format
*
* @memberof Serializer
*/
to_json(): {};
/**
* Serialize the object
*
* @memberof Serializer
*/
serialize(obj: any): void;
/**
* Hash data using SHA-512 and return the first 256 bits in HEX string format.
*
* @memberof Serializer
*/
hash(prefix: any): string;
};
adr_json(so: any, account: any): any;
/**
* Use TRANSACTION_TYPES info to check if the input TX missing any info
*
* @static
* @memberof Serializer
*/
check_no_missing_fields(typedef: any, obj: any): void;
/**
* Conver the input data structure to JSON format
*
* @static
* @memberof Serializer
*/
jsonify_structure(structure: any, field_name: any): any;
get_field_header(type_id: number, field_id: number): number[];
/**
* Sort the input cmd according to the TX type code.
*
* @static
* @memberof Serializer
*/
sort_typedef(typedef: any[]): any[];
lookup_type_tx(id: any): any;
lookup_type_le(id: any): any;
};
export { Factory };
//# sourceMappingURL=Serializer.d.ts.map