@atproto/identity 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/LICENSE.txt +1 -1
- package/dist/did/atproto-data.d.ts +4 -0
- package/dist/did/memory-cache.d.ts +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +2 -2
- package/dist/types.d.ts +5 -5
- package/package.json +2 -2
- package/src/did/atproto-data.ts +6 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { DidDocument } from '@atproto/common-web';
|
|
2
2
|
export { didDocument } from '@atproto/common-web';
|
|
3
3
|
export type { DidDocument } from '@atproto/common-web';
|
|
4
|
-
export
|
|
4
|
+
export type IdentityResolverOpts = {
|
|
5
5
|
timeout?: number;
|
|
6
6
|
plcUrl?: string;
|
|
7
7
|
didCache?: DidCache;
|
|
8
8
|
backupNameservers?: string[];
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type HandleResolverOpts = {
|
|
11
11
|
timeout?: number;
|
|
12
12
|
backupNameservers?: string[];
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type DidResolverOpts = {
|
|
15
15
|
timeout?: number;
|
|
16
16
|
plcUrl?: string;
|
|
17
17
|
didCache?: DidCache;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type AtprotoData = {
|
|
20
20
|
did: string;
|
|
21
21
|
signingKey: string;
|
|
22
22
|
handle: string;
|
|
23
23
|
pds: string;
|
|
24
24
|
};
|
|
25
|
-
export
|
|
25
|
+
export type CacheResult = {
|
|
26
26
|
did: string;
|
|
27
27
|
doc: DidDocument;
|
|
28
28
|
updatedAt: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/identity",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Library for decentralized identities in atproto using DIDs and handles",
|
|
6
6
|
"keywords": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"axios": "^0.27.2",
|
|
20
|
-
"@atproto/common-web": "^0.2.
|
|
20
|
+
"@atproto/common-web": "^0.2.4",
|
|
21
21
|
"@atproto/crypto": "^0.3.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
package/src/did/atproto-data.ts
CHANGED
|
@@ -20,7 +20,13 @@ export {
|
|
|
20
20
|
export const getKey = (doc: DidDocument): string | undefined => {
|
|
21
21
|
const key = getSigningKey(doc)
|
|
22
22
|
if (!key) return undefined
|
|
23
|
+
return getDidKeyFromMultibase(key)
|
|
24
|
+
}
|
|
23
25
|
|
|
26
|
+
export const getDidKeyFromMultibase = (key: {
|
|
27
|
+
type: string
|
|
28
|
+
publicKeyMultibase: string
|
|
29
|
+
}): string | undefined => {
|
|
24
30
|
const keyBytes = crypto.multibaseToBytes(key.publicKeyMultibase)
|
|
25
31
|
let didKey: string | undefined = undefined
|
|
26
32
|
if (key.type === 'EcdsaSecp256r1VerificationKey2019') {
|