postchain-client
Version:
Client library for accessing a Postchain node through REST.
22 lines • 710 B
JavaScript
import { z } from "zod";
const bufferSchema = z.custom(val => Buffer.isBuffer(val), {
message: "Expected Buffer",
});
const rawGtvSchema = z.lazy(() => z.union([
z.null(),
z.boolean(),
bufferSchema,
z.string(),
z.number(),
z.bigint(),
z.array(rawGtvSchema),
z.record(rawGtvSchema),
]));
const rawGtxOpSchema = z.tuple([z.string(), z.array(rawGtvSchema)]);
const rawGtxBodySchema = z.tuple([bufferSchema, z.array(rawGtxOpSchema), z.array(bufferSchema)]);
const rawGtxSchema = z.tuple([rawGtxBodySchema, z.array(bufferSchema)]);
export function isRawGtx(value) {
const result = rawGtxSchema.safeParse(value);
return result.success;
}
//# sourceMappingURL=rawGtx.js.map