@gala-chain/api ∙ API
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
>