-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from hypersign-protocol/HSSTUD-50
use walletAddress in place of address and fixed not able to register …
- Loading branch information
Showing
11 changed files
with
222 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,57 @@ | ||
import { ApiHideProperty, ApiProperty } from "@nestjs/swagger"; | ||
import { DidDoc, UpdateDidDto } from "./update-did.dto"; | ||
import { IsArray, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateNested } from "class-validator"; | ||
import { Type } from "class-transformer"; | ||
import { ValidateVerificationMethodId } from "src/utils/customDecorator/vmId.decorator"; | ||
import { type } from "os"; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { DidDoc } from './update-did.dto'; | ||
import { IsEnum, IsOptional, IsString, ValidateNested } from 'class-validator'; | ||
import { Type } from 'class-transformer'; | ||
import { ValidateVerificationMethodId } from 'src/utils/customDecorator/vmId.decorator'; | ||
|
||
export enum IClientSpec { | ||
'eth-personalSign' = 'eth-personalSign', | ||
'cosmos-ADR036' = 'cosmos-ADR036', | ||
'eth-personalSign' = 'eth-personalSign', | ||
'cosmos-ADR036' = 'cosmos-ADR036', | ||
} | ||
export class RegisterDidDto { | ||
@ApiProperty({ | ||
description: 'Did doc to be updated', | ||
type: DidDoc, | ||
}) | ||
@Type(() => DidDoc) | ||
@ValidateNested({each:true}) | ||
didDocument: DidDoc; | ||
|
||
@ApiProperty({ | ||
description: 'Verification Method id for did updation', | ||
example: 'did:hid:testnet:........#key-${idx}', | ||
required:true | ||
}) | ||
@ValidateVerificationMethodId() | ||
@IsString() | ||
verificationMethodId: string; | ||
|
||
|
||
@ApiProperty({ | ||
description: | ||
"IClientSpec 'eth-personalSign' or 'cosmos-ADR036'", | ||
example: 'eth-personalSign', | ||
name: 'clientSpec', | ||
}) | ||
@IsOptional() | ||
@IsEnum(IClientSpec) | ||
clientSpec: IClientSpec; | ||
|
||
|
||
@ApiProperty({ | ||
description: | ||
"Signature for clientSpec", | ||
example: 'afafljagahgp9agjagknaglkj/kagka=', | ||
name: 'signature', | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
signature: string; | ||
@ApiProperty({ | ||
description: | ||
"Signature for clientSpec cosmos-ADR036", | ||
example: "hid148273582", | ||
name: 'address', | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
address: string | ||
|
||
|
||
@ApiProperty({ | ||
description: 'Did doc to be updated', | ||
type: DidDoc, | ||
}) | ||
@Type(() => DidDoc) | ||
@ValidateNested({ each: true }) | ||
didDocument: DidDoc; | ||
|
||
@ApiProperty({ | ||
description: 'Verification Method id for did updation', | ||
example: 'did:hid:testnet:........#key-${idx}', | ||
required: true, | ||
}) | ||
@ValidateVerificationMethodId() | ||
@IsString() | ||
verificationMethodId: string; | ||
|
||
@ApiProperty({ | ||
description: "IClientSpec 'eth-personalSign' or 'cosmos-ADR036'", | ||
example: 'eth-personalSign', | ||
name: 'clientSpec', | ||
required: false, | ||
}) | ||
@IsOptional() | ||
@IsEnum(IClientSpec) | ||
clientSpec?: IClientSpec; | ||
|
||
@ApiProperty({ | ||
description: 'Signature for clientSpec', | ||
example: 'afafljagahgp9agjagknaglkj/kagka=', | ||
name: 'signature', | ||
required: false, | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
signature?: string; | ||
@ApiProperty({ | ||
description: 'Checksum address from web3 wallet', | ||
example: 'hid148273582', | ||
name: 'address', | ||
required: false, | ||
}) | ||
@IsOptional() | ||
@IsString() | ||
address?: string; | ||
} | ||
|
||
|
Oops, something went wrong.