assetValidator

See source code

Validator for TLAsset records that ensures runtime type safety. Uses a discriminated union based on the 'type' field to validate different asset types.

assetValidator: T.Validator<TLAsset>;

Example

// Validation happens automatically when assets are stored
try {
  const validatedAsset = assetValidator.validate(assetData);
  store.put([validatedAsset]);
} catch (error) {
  console.error("Asset validation failed:", error.message);
}
Prev
AssetRecordType
Next
bindingIdValidator