Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import { ValueObject } from 'src/shared/domain/ValueObject';import { err, ok, Result } from 'src/shared/core/Result';
interface DIDProps { value: string;}
export class DID extends ValueObject<DIDProps> { get value(): string { return this.props.value; }
private constructor(props: DIDProps) { super(props); }
public static create(did: string): Result<DID> { if (!did || !did.startsWith('did:plc:')) { return err(new Error("Invalid DID format. Must start with 'did:plc:'")); }
return ok(new DID({ value: did })); }
public toString(): string { return this.props.value; }}