import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { ArrayMinSize, IsEthereumAddress, IsNumber, IsOptional, IsString, MaxLength, MinLength } from 'class-validator'; import { User } from './database/entities'; export enum MessageType { AUTH = 'auth', UNLINK = 'unlink', } export enum QuestType { DEGEN_SCORE = 'DEGEN_SCORE', DAILY_CHECK_IN = 'DAILY_CHECK_IN', FUNKI_DEGEN = 'FUNKI_DEGEN', // extend trophy type OP_AIRDROP = 'OP_AIRDROP', BASE_DEGEN = 'BASE_DEGEN', ZORA_MINTER = 'ZORA_MINTER', OP_DEGEN = 'OP_DEGEN', PARTNERS_NFTS_HOLDER = 'PARTNERS_NFTS_HOLDER', OP_HOLDER = 'OP_HOLDER', EIGEN_AIRDROP = 'EIGEN_AIRDROP', ATHER_ID_OWNER = 'ATHER_ID_OWNER', SIPHER_TOKEN_HOLDER = 'SIPHER_TOKEN_HOLDER', RE_ALT_HOLDER = 'RE_ALT_HOLDER', LINK_SOCIAL = 'LINK_SOCIAL', SOCIAL_REACTION = 'SOCIAL_REACTION', } export class EvmAuthDto { @ApiProperty({ required: false, nullable: true, default: 'funzone' }) @IsString() @IsOptional() origin?: string; @IsString() @ApiProperty() @Transform(({ value }) => value.toLowerCase()) publicKey: string; @ApiProperty({ enum: MessageType, enumName: 'MessageType' }) type: MessageType; } export class EvmAuthResponse { @ApiProperty() nonce: string; @ApiProperty() message: string; } export class EvmValidateAuthDto extends EvmAuthDto { @IsString() @ApiProperty() nonce: string; @IsString() @ApiProperty() signature: string; @IsString() @IsOptional() @ApiProperty({ required: false }) provider?: string; } export class CustomTokenResponse { @ApiProperty() customToken: string; } export class GetConnectedUserResponse { @IsString() @ApiProperty() uid: string; } export class TelegramAuthorizeRequest { [key: string]: string; } export class SetUsernameDto { @ApiProperty() @IsString() @MinLength(2) @MaxLength(32) username: string; } export class DiscordAuthorizeDto { @ApiProperty() @IsString() @MinLength(1) code: string; } export class RedditAuthorizeDto { @ApiProperty() @IsString() @MinLength(1) code: string; } export class OnboardDto { @ApiProperty() @IsString() @Transform(({ value }) => value.toUpperCase()) refCode: string; } export class OnboardWalletDto { @ApiProperty() @IsString() @IsEthereumAddress() @Transform(({ value }) => value.toLowerCase()) walletAddress: string; } export class GetWaitListUsersDto { @ApiProperty({ default: 0, required: false }) @Transform(({ value }) => parseInt(value)) @IsNumber() @IsOptional() skip?: number; @ApiProperty({ default: 20, required: false }) @Transform(({ value }) => parseInt(value)) @IsNumber() @IsOptional() take?: number; @ApiProperty({ required: false }) @IsString() @IsOptional() referrerUid?: string; @ApiProperty({ required: false, enum: ['asc', 'desc'], enumName: 'SortDirection' }) @IsString() @IsOptional() sortOrder?: 'asc' | 'desc'; } export class GetWaitListUsersResponse { @ApiProperty({ type: () => [User] }) users: User[]; @ApiProperty() total: number; } export class CheckWaitListByAddressesDto { @ApiProperty({ type: () => [String] }) @IsEthereumAddress({ each: true }) @ArrayMinSize(1) addresses: string[]; } export class CheckWaitListByTelegramIdDto { @ApiProperty({ type: String }) telegramId: string; }