Skip to content

@gala-chain/apiAPI


API > parseValidDTO

Function: parseValidDTO()

parseValidDTO\<T>(constructor, jsonStringOrObj): Promise\<T>

Parses JSON string and creates a Promise with valid DTO. Throws exception in case of validation errors.

Type parameters

T extends ChainCallDTO

Parameters

constructor: ClassConstructor\<Inferred\<T, ChainCallDTO>>

jsonStringOrObj: string | Record\<string, unknown>

Source

chain-api/src/types/dtos.ts:61