@ceramicnetwork/3id-did-resolver
Advanced tools
Comparing version 0.0.1 to 0.1.0-alpha.0
@@ -1,11 +0,15 @@ | ||
import type Ceramic from '@ceramicnetwork/ceramic-core'; | ||
import type { DIDResolver, DIDDocument } from 'did-resolver'; | ||
interface Document { | ||
content: any; | ||
} | ||
interface Ceramic { | ||
loadDocument(docId: string): Promise<Document>; | ||
} | ||
interface ResolverRegistry { | ||
[index: string]: DIDResolver; | ||
} | ||
declare function wrapDocument(content: any, did: string): DIDDocument; | ||
export declare function wrapDocument(content: any, did: string): DIDDocument; | ||
declare const _default: { | ||
wrapDocument: typeof wrapDocument; | ||
getResolver: (ceramic: Ceramic) => ResolverRegistry; | ||
}; | ||
export default _default; |
@@ -33,4 +33,4 @@ "use strict"; | ||
} | ||
exports.wrapDocument = wrapDocument; | ||
exports.default = { | ||
wrapDocument, | ||
getResolver: (ceramic) => ({ | ||
@@ -37,0 +37,0 @@ '3': (did, parsed) => __awaiter(void 0, void 0, void 0, function* () { |
{ | ||
"name": "@ceramicnetwork/3id-did-resolver", | ||
"version": "0.0.1", | ||
"version": "0.1.0-alpha.0", | ||
"description": "DID Resolver for the 3ID method", | ||
@@ -29,3 +29,2 @@ "keywords": [ | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -35,3 +34,2 @@ "@babel/core": "^7.9.0", | ||
"@babel/preset-typescript": "^7.9.0", | ||
"@ceramicnetwork/ceramic-core": "^0.0.1", | ||
"@types/events": "^3.0.0", | ||
@@ -52,3 +50,4 @@ "@types/node": "^13.9.5", | ||
] | ||
} | ||
}, | ||
"gitHead": "2e083cf56d0a42785468385f23f3bb1159c6ca6c" | ||
} |
# 3ID DID Resolver | ||
> TODO: description | ||
> 3ID is a DID method that uses the Ceramic network to resolve DID documents. | ||
## Usage | ||
## Getting started | ||
### Installation | ||
``` | ||
import { getResolver } from '@ceramicnetwork/3id-did-resolver' | ||
$ npm install @ceramicnetwork/3id-did-resolver | ||
``` | ||
### Usage | ||
``` | ||
import ThreeIdResolver from '@ceramicnetwork/3id-did-resolver' | ||
import { Resolver } from 'did-resolver' | ||
@@ -18,3 +25,3 @@ | ||
// where resolver is a function used by the generic did resolver. | ||
const threeIdResolver = getResolver(ceramic) | ||
const threeIdResolver = ThreeIdResolver.getResolver(ceramic) | ||
const didResolver = Resolver(threeIdResolver) | ||
@@ -25,1 +32,19 @@ | ||
``` | ||
## Development | ||
Run tests: | ||
``` | ||
$ npm test | ||
``` | ||
Run linter: | ||
``` | ||
npm run lint | ||
``` | ||
## Contributing | ||
We are happy to accept small and large contributions. Make sure to check out the [Ceramic specifications](https://github.com/ceramicnetwork/specs) for details of how the protocol works. | ||
## License |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6019
13
6
56
49