Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove private key and use signing key #4

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/schema-manager.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading