diff --git a/packages/daf-ethr-did/src/identity-controller.ts b/packages/daf-ethr-did/src/identity-controller.ts index 562bae876..bc1b30d9a 100644 --- a/packages/daf-ethr-did/src/identity-controller.ts +++ b/packages/daf-ethr-did/src/identity-controller.ts @@ -14,6 +14,7 @@ export class IdentityController extends AbstractIdentityController { private address: string private gas?: number private ttl?: number + private registry?: string constructor(options: { did: string @@ -23,6 +24,7 @@ export class IdentityController extends AbstractIdentityController { address: string ttl?: number gas?: number + registry?: string }) { super() this.did = options.did @@ -32,10 +34,15 @@ export class IdentityController extends AbstractIdentityController { this.address = options.address this.ttl = options.ttl || DEFAULT_TTL this.gas = options.gas || DEFAULT_GAS + this.registry = options.registry } async addService(service: { id: string; type: string; serviceEndpoint: string }): Promise { - const ethrDid = new EthrDID({ address: this.address, provider: this.web3Provider }) + const ethrDid = new EthrDID({ + address: this.address, + provider: this.web3Provider, + registry: this.registry + }) const attribute = 'did/svc/' + service.type const value = service.serviceEndpoint @@ -53,7 +60,11 @@ export class IdentityController extends AbstractIdentityController { async addPublicKey(type: 'Ed25519' | 'Secp256k1', proofPurpose?: string[]): Promise { const serializedIdentity = await this.identityStore.get(this.did) - const ethrDid = new EthrDID({ address: this.address, provider: this.web3Provider }) + const ethrDid = new EthrDID({ + address: this.address, + provider: this.web3Provider, + registry: this.registry + }) const key = await this.kms.createKey(type) diff --git a/packages/daf-ethr-did/src/identity-provider.ts b/packages/daf-ethr-did/src/identity-provider.ts index d04fa6668..517aa7d66 100644 --- a/packages/daf-ethr-did/src/identity-provider.ts +++ b/packages/daf-ethr-did/src/identity-provider.ts @@ -29,6 +29,7 @@ export class IdentityProvider extends AbstractIdentityProvider { private identityStore: AbstractIdentityStore private gas?: number private ttl?: number + private registry?: string constructor(options: { kms: AbstractKeyManagementSystem @@ -38,6 +39,7 @@ export class IdentityProvider extends AbstractIdentityProvider { web3Provider?: object ttl?: number gas?: number + registry?: string }) { super() this.kms = options.kms @@ -49,6 +51,7 @@ export class IdentityProvider extends AbstractIdentityProvider { this.description = 'did:ethr ' + options.network + ' ' + this.description this.ttl = options.ttl this.gas = options.gas + this.registry = options.registry } private async identityFromSerialized(serializedIdentity: SerializedIdentity): Promise {