UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

1 lines • 2.65 kB
{"version":3,"file":"VerificationMethod.mjs","names":[],"sources":["../../../../../src/modules/dids/domain/verificationMethod/VerificationMethod.ts"],"sourcesContent":["import { IsOptional, IsString } from 'class-validator'\nimport type { Jwk } from '../../../kms'\n\nexport interface VerificationMethodOptions {\n id: string\n type: string\n controller: string\n publicKeyBase58?: string\n publicKeyBase64?: string\n publicKeyJwk?: Jwk\n publicKeyHex?: string\n publicKeyMultibase?: string\n publicKeyPem?: string\n blockchainAccountId?: string\n ethereumAddress?: string\n}\n\nexport class VerificationMethod {\n public constructor(options: VerificationMethodOptions) {\n if (options) {\n this.id = options.id\n this.type = options.type\n this.controller = options.controller\n this.publicKeyBase58 = options.publicKeyBase58\n this.publicKeyBase64 = options.publicKeyBase64\n this.publicKeyJwk = options.publicKeyJwk\n this.publicKeyHex = options.publicKeyHex\n this.publicKeyMultibase = options.publicKeyMultibase\n this.publicKeyPem = options.publicKeyPem\n this.blockchainAccountId = options.blockchainAccountId\n this.ethereumAddress = options.ethereumAddress\n }\n }\n\n @IsString()\n public id!: string\n\n @IsString()\n public type!: string\n\n @IsString()\n public controller!: string\n\n @IsOptional()\n @IsString()\n public publicKeyBase58?: string\n\n @IsOptional()\n @IsString()\n public publicKeyBase64?: string\n\n // TODO: validation of JWK\n public publicKeyJwk?: Jwk\n\n @IsOptional()\n @IsString()\n public publicKeyHex?: string\n\n @IsOptional()\n @IsString()\n public publicKeyMultibase?: string\n\n @IsOptional()\n @IsString()\n public publicKeyPem?: string\n\n @IsOptional()\n @IsString()\n public blockchainAccountId?: string\n\n @IsOptional()\n @IsString()\n public ethereumAddress?: string\n}\n"],"mappings":";;;;AAiBA,IAAa,qBAAb,MAAgC;CAC9B,YAAmB,SAAoC;EACrD,IAAI,SAAS;GACX,KAAK,KAAK,QAAQ;GAClB,KAAK,OAAO,QAAQ;GACpB,KAAK,aAAa,QAAQ;GAC1B,KAAK,kBAAkB,QAAQ;GAC/B,KAAK,kBAAkB,QAAQ;GAC/B,KAAK,eAAe,QAAQ;GAC5B,KAAK,eAAe,QAAQ;GAC5B,KAAK,qBAAqB,QAAQ;GAClC,KAAK,eAAe,QAAQ;GAC5B,KAAK,sBAAsB,QAAQ;GACnC,KAAK,kBAAkB,QAAQ;EACjC;CACF;AAyCF;AAvCG,WAAA,CAAA,SAAS,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,mBAAA,WAAA,MAAA,KAAA,CAAA;AAGT,WAAA,CAAA,SAAS,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,mBAAA,WAAA,QAAA,KAAA,CAAA;AAGT,WAAA,CAAA,SAAS,GAAA,mBAAA,eAAA,MAAA,CAAA,GAAA,mBAAA,WAAA,cAAA,KAAA,CAAA;;CAGT,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,SAAS;;;;CAMT,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,SAAS;;;;CAGT,WAAW;CACX,SAAS"}