File

src/shared/dto/on-chain-field.dto.ts

Index

Properties

Properties

name
Type : string
Decorators :
@ApiProperty({type: 'string'})
@IsString()
@IsNotEmpty()
type
Type : DataFieldType
Decorators :
@ApiProperty({required: true, enumName: 'The registry type', enum: undefined})
@IsEnum(DataFieldType)
value
Decorators :
@ApiProperty({type: 'string'})
@IsNotEmpty()
import { ApiProperty } from "@nestjs/swagger";
import { IsString, IsNotEmpty, IsEnum } from "class-validator";
import { DataFieldType } from "src/admin/EternalRegistry.interface";

export class OnChainFieldDTO {
  @ApiProperty({ type: "string" })
  @IsString()
  @IsNotEmpty()
  name: string;

  @ApiProperty({
    required: true,
    enumName: "The registry type",
    enum: [
      "Uint",
      "Bool",
      "String",
      "Bytes",
      "Address",
      "AddressArrayIndexValue",
      "getAddressArray",
    ],
  })
  @IsEnum(DataFieldType)
  type: DataFieldType;

  @ApiProperty({ type: "string" })
  @IsNotEmpty()
  value: unknown;
}

results matching ""

    No results matching ""