diff --git a/libs/src/services/dataContracts/EntityManagerClient.ts b/libs/src/services/dataContracts/EntityManagerClient.ts index ce96a4d3bde..7cdfe6c872c 100644 --- a/libs/src/services/dataContracts/EntityManagerClient.ts +++ b/libs/src/services/dataContracts/EntityManagerClient.ts @@ -116,20 +116,7 @@ export class EntityManagerClient extends ContractClient { metadataMultihash, nonce ) - const nethermindSignatureData = - signatureSchemas.generators.getManageEntityData( - 1056800, // TODO get from chain after web3Manager uses nethermind only - nethermindContractAddress, - userId, - entityType, - entityId, - action, - metadataMultihash, - nonce - ) - let sig - let nethermindSig if (privateKey) { sig = sigUtil.signTypedData( SafeBuffer.from(privateKey, 'hex') as unknown as Buffer, @@ -139,9 +126,6 @@ export class EntityManagerClient extends ContractClient { ) } else { sig = await this.web3Manager.signTypedData(signatureData) - nethermindSig = await this.web3Manager.signTypedData( - nethermindSignatureData - ) } const method = await this.getMethod( 'manageEntity', @@ -154,17 +138,34 @@ export class EntityManagerClient extends ContractClient { sig ) - const nethermindMethod = await this.getMethod( - 'manageEntity', - userId, - entityType, - entityId, - action, - metadataMultihash, - nonce, - nethermindSig - ) + let nethermindMethod + if (nethermindContractAddress) { + const nethermindSignatureData = + signatureSchemas.generators.getManageEntityData( + 1056800, // TODO get from chain after web3Manager uses nethermind only + nethermindContractAddress, + userId, + entityType, + entityId, + action, + metadataMultihash, + nonce + ) + const nethermindSig = await this.web3Manager.signTypedData( + nethermindSignatureData + ) + nethermindMethod = await this.getMethod( + 'manageEntity', + userId, + entityType, + entityId, + action, + metadataMultihash, + nonce, + nethermindSig + ) + } const tx = await this.web3Manager.sendTransaction( method, this.contractRegistryKey, diff --git a/libs/src/services/identity/IdentityService.ts b/libs/src/services/identity/IdentityService.ts index ade801b8aeb..facf85068b8 100644 --- a/libs/src/services/identity/IdentityService.ts +++ b/libs/src/services/identity/IdentityService.ts @@ -397,7 +397,7 @@ export class IdentityService { gasLimit: number, handle: string | null = null, nethermindContractAddress: string | null | undefined, - nethermindEncodedAbi: string + nethermindEncodedAbi: string | undefined ): Promise<{ receipt: TransactionReceipt }> { return await this._makeRequest({ url: '/relay', diff --git a/libs/src/services/web3Manager/Web3Manager.ts b/libs/src/services/web3Manager/Web3Manager.ts index 070389b3aef..1914fa80b19 100644 --- a/libs/src/services/web3Manager/Web3Manager.ts +++ b/libs/src/services/web3Manager/Web3Manager.ts @@ -221,7 +221,7 @@ export class Web3Manager { }) } else { const encodedABI = contractMethod.encodeABI() - const nethermindEncodedAbi = nethermindContractMethod!.encodeABI() + const nethermindEncodedAbi = nethermindContractMethod?.encodeABI() const response = await retry( async (bail) => { try {