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

Missing Dependency #11

Open
crgold opened this issue Mar 3, 2023 · 0 comments
Open

Missing Dependency #11

crgold opened this issue Mar 3, 2023 · 0 comments

Comments

@crgold
Copy link

crgold commented Mar 3, 2023

When I attempt to run some code that uses this, I get the following error. It seems polygon-did-registar needs @ethersproject/wallet but it is not included when installing it.

polyDIDError

This is the code in the index file:

`import { createDID, registerDID } from "@ayanworks/polygon-did-registrar";
import * as dotenv from 'dotenv'
dotenv.config()

const network: string = "testnet";

async function main() {
// pad private key with 0x
let pk = process.env.PRIVATE_KEY;
if (!pk.startsWith("0x")) {
// pad 0x to private key
pk = 0x${pk};
}

// create a new did
const did = await createDID(network, pk);
console.log("DID created: ", did.data.did);

// register the did
const txHash = await registerDID(did.data.did, pk);
console.log("DID registered: ", txHash);
}

main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant