From af00bab1f0d025286208ce7dd08554d88a8ad7c1 Mon Sep 17 00:00:00 2001 From: Sai Ranjit Tummalapalli Date: Tue, 30 Jan 2024 17:11:17 +0530 Subject: [PATCH] refactor: remove private key and use signing key (#4) Signed-off-by: Sai Ranjit Tummalapalli --- src/schema-manager.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/schema-manager.ts b/src/schema-manager.ts index 8a3a42b..847b4a3 100644 --- a/src/schema-manager.ts +++ b/src/schema-manager.ts @@ -1,4 +1,4 @@ -import { Contract, JsonRpcProvider, Wallet } from 'ethers' +import { Contract, JsonRpcProvider, SigningKey, Wallet } from 'ethers' import { parseDid, validateDid } from './utils/did' import { v4 as uuidv4 } from 'uuid' import SchemaRegistryAbi from './abi/SchemaRegistry.json' @@ -9,7 +9,7 @@ import axios from 'axios' export type PolygonDidInitOptions = { didRegistrarContractAddress: string rpcUrl: string - privateKey: string + signingKey: SigningKey schemaManagerContractAddress: string serverUrl: string fileServerToken: string @@ -46,10 +46,10 @@ export class PolygonSchema { rpcUrl, serverUrl, fileServerToken, - privateKey, + signingKey, }: PolygonDidInitOptions) { const provider = new JsonRpcProvider(rpcUrl) - const wallet = new Wallet(privateKey, provider) + const wallet = new Wallet(signingKey, provider) this.didRegistry = new Contract( didRegistrarContractAddress, DidRegistryContract.abi,