diff --git a/example/resolver.js b/example/resolver.js index 939370946..b84b5b4a5 100644 --- a/example/resolver.js +++ b/example/resolver.js @@ -89,7 +89,6 @@ async function main() { 'did:jolo:e76fb4b4900e43891f613066b9afca366c6d22f7d87fc9f78a91515be24dfb21', 'did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0', 'did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de', - 'did:neoid:priv:b4eeeb80d20bfb38b23001d0659ce0c1d96be0aa', 'did:elem:EiAS3mqC4OLMKOwcz3ItIL7XfWduPT7q3Fa4vHgiCfSG2A', 'did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH', 'did:kilt:5GFs8gCumJcZDDWof5ETFqDFEsNwCsVJUj2bX7y4xBLxN5qT', diff --git a/src/api.js b/src/api.js index 1417f2e9b..e79bed15e 100644 --- a/src/api.js +++ b/src/api.js @@ -68,17 +68,20 @@ class DockAPI { }, }); + await this.initKeyring(keyring); + this.blobModule = new BlobModule(this.api); this.didModule = new DIDModule(this.api); this.revocationModule = new RevocationModule(this.api); - await cryptoWaitReady(); + return this.api; + } + async initKeyring(keyring = null) { if (!this.keyring || keyring) { + await cryptoWaitReady(); this.keyring = new Keyring(keyring || { type: 'sr25519' }); } - - return this.api; } async disconnect() { diff --git a/src/utils/vc.js b/src/utils/vc.js index 8a678f9b6..751e25df4 100644 --- a/src/utils/vc.js +++ b/src/utils/vc.js @@ -59,7 +59,10 @@ export function getSuiteFromKeyDoc(keyDoc) { default: throw new Error(`Unknown key type ${keyDoc.type}.`); } - return new Cls({ keypair: keyDoc.keypair, publicKey: keyDoc.publicKey, verificationMethod: keyDoc.id }); + return new Cls({ + ...keyDoc, + verificationMethod: keyDoc.id, + }); } /**