/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../lib/primitives.js";
import { safeParse } from "../lib/schemas.js";
import { Result as SafeParseResult } from "../types/fp.js";
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
/**
* ConstructionCombineResponse is returned by `/construction/combine`. The network payload will be sent directly to the `construction/submit` endpoint.
*/
export type ConstructionCombineResponse = {
signedTransaction: string;
};
/** @internal */
export const ConstructionCombineResponse$inboundSchema: z.ZodType<
ConstructionCombineResponse,
z.ZodTypeDef,
unknown
> = z.object({
signed_transaction: z.string(),
}).transform((v) => {
return remap$(v, {
"signed_transaction": "signedTransaction",
});
});
/** @internal */
export type ConstructionCombineResponse$Outbound = {
signed_transaction: string;
};
/** @internal */
export const ConstructionCombineResponse$outboundSchema: z.ZodType<
ConstructionCombineResponse$Outbound,
z.ZodTypeDef,
ConstructionCombineResponse
> = z.object({
signedTransaction: z.string(),
}).transform((v) => {
return remap$(v, {
signedTransaction: "signed_transaction",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace ConstructionCombineResponse$ {
/** @deprecated use `ConstructionCombineResponse$inboundSchema` instead. */
export const inboundSchema = ConstructionCombineResponse$inboundSchema;
/** @deprecated use `ConstructionCombineResponse$outboundSchema` instead. */
export const outboundSchema = ConstructionCombineResponse$outboundSchema;
/** @deprecated use `ConstructionCombineResponse$Outbound` instead. */
export type Outbound = ConstructionCombineResponse$Outbound;
}
export function constructionCombineResponseToJSON(
constructionCombineResponse: ConstructionCombineResponse,
): string {
return JSON.stringify(
ConstructionCombineResponse$outboundSchema.parse(
constructionCombineResponse,
),
);
}
export function constructionCombineResponseFromJSON(
jsonString: string,
): SafeParseResult<ConstructionCombineResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => ConstructionCombineResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'ConstructionCombineResponse' from JSON`,
);
}