@zlattice/lattice-js
Version:
Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)
23 lines • 1.1 kB
TypeScript
import * as protobuf from "protobufjs";
/**
* Get the first(main) protobuf message type from a proto content string.
* @param protoContent - The proto content string.
* @returns The protobuf message type.
*/
declare function getMessageProtoType(protoContent: string): Promise<protobuf.Type>;
/**
* Serialize a message to a protobuf message.
* @param messageTypeOrProtoContent - The protobuf message type or the proto content string.
* @param json - The json string to serialize.
* @returns The serialized message.
*/
declare function serializeMessage(messageTypeOrProtoContent: protobuf.Type | string, json: string): Promise<Uint8Array>;
/**
* Deserialize a protobuf message to a json string.
* @param messageTypeOrProtoContent - The protobuf message type or the proto content string.
* @param data - The serialized message.
* @returns The json string.
*/
declare function deserializeMessage(messageTypeOrProtoContent: protobuf.Type | string, data: Uint8Array): Promise<string>;
export { getMessageProtoType, serializeMessage, deserializeMessage };
//# sourceMappingURL=serializer.d.ts.map