@peerbit/keychain
Advanced tools
Comparing version 1.0.17 to 1.0.18-2b760c3
{ | ||
"name": "@peerbit/keychain", | ||
"version": "1.0.17", | ||
"description": "Utility functions for keychain", | ||
"type": "module", | ||
"sideEffects": false, | ||
"module": "lib/esm/index.js", | ||
"types": "lib/esm/index.d.ts", | ||
"exports": { | ||
"import": "./lib/esm/index.js", | ||
"require": "./lib/cjs/index.js" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src", | ||
"!src/**/__tests__", | ||
"!lib/**/__tests__", | ||
"LICENSE" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "shx rm -rf lib/*", | ||
"build": "yarn clean && tsc -p tsconfig.json", | ||
"test": "node ../../../node_modules/.bin/jest test -c ../../../jest.config.ts --runInBand --forceExit", | ||
"test:unit": "node ../../../node_modules/.bin/jest test -c ../../../jest.config.unit.ts --runInBand --forceExit", | ||
"test:integration": "node ../node_modules/.bin/jest test -c ../../../jest.config.integration.ts --runInBand --forceExit" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@peerbit/any-store": "^2.0.2", | ||
"@peerbit/crypto": "^2.2.0" | ||
}, | ||
"gitHead": "fcd486b9a5c3b7d94e2ae14f1b06ab2a0f7841ad" | ||
"name": "@peerbit/keychain", | ||
"version": "1.0.18-2b760c3", | ||
"description": "Utility functions for keychain", | ||
"sideEffects": false, | ||
"type": "module", | ||
"types": "./dist/src/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
], | ||
"src/*": [ | ||
"*", | ||
"dist/*", | ||
"dist/src/*", | ||
"dist/src/*/index" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist", | ||
"!dist/test", | ||
"!**/*.tsbuildinfo" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.js" | ||
} | ||
}, | ||
"eslintConfig": { | ||
"extends": "peerbit", | ||
"parserOptions": { | ||
"project": true, | ||
"sourceType": "module" | ||
}, | ||
"ignorePatterns": [ | ||
"!.aegir.js", | ||
"test/ts-use", | ||
"*.d.ts" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"build": "aegir build --no-bundle", | ||
"test": "aegir test", | ||
"lint": "aegir lint" | ||
}, | ||
"author": "dao.xyz", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@peerbit/crypto": "2.3.0-2b760c3", | ||
"@peerbit/any-store": "2.1.0-2b760c3" | ||
} | ||
} |
@@ -0,18 +1,22 @@ | ||
import { type Constructor, deserialize, serialize } from "@dao-xyz/borsh"; | ||
import { type AnyStore } from "@peerbit/any-store"; | ||
import { createStore } from "@peerbit/any-store"; | ||
import { | ||
type ByteKey, | ||
Ed25519Keypair, | ||
type Ed25519PublicKey, | ||
Keypair, | ||
type PublicKeyEncryptionKey, | ||
type PublicSignKey, | ||
type Secp256k1Keypair, | ||
type Secp256k1PublicKey, | ||
X25519Keypair, | ||
Keypair, | ||
Ed25519PublicKey, | ||
X25519PublicKey, | ||
ByteKey, | ||
Secp256k1Keypair, | ||
Secp256k1PublicKey, | ||
PublicKeyEncryptionKey, | ||
PublicSignKey, | ||
toBase64 | ||
type X25519PublicKey, | ||
toBase64, | ||
} from "@peerbit/crypto"; | ||
import { KeyParameters, Keychain, KeypairParameters } from "./interface.js"; | ||
import { AnyStore } from "@peerbit/any-store"; | ||
import { serialize, deserialize, Constructor } from "@dao-xyz/borsh"; | ||
import { createStore } from "@peerbit/any-store"; | ||
import { | ||
type KeyParameters, | ||
type Keychain, | ||
type KeypairParameters, | ||
} from "./interface.js"; | ||
@@ -33,6 +37,6 @@ export type { Keychain }; | ||
constructor( | ||
readonly properties: { store: AnyStore } = { store: createStore() } | ||
readonly properties: { store: AnyStore } = { store: createStore() }, | ||
) {} | ||
async import( | ||
parameters: (KeypairParameters | KeyParameters) & { id?: Uint8Array } | ||
parameters: (KeypairParameters | KeyParameters) & { id?: Uint8Array }, | ||
): Promise<void> { | ||
@@ -70,3 +74,3 @@ let bytes: Uint8Array; | ||
| PublicKeyEncryptionKey, | ||
Q = KeypairFromPublicKey<T> | ||
Q = KeypairFromPublicKey<T>, | ||
>(publicKey: T): Promise<Q | undefined> { | ||
@@ -81,3 +85,3 @@ const key = await this.properties.store.get(toBase64(serialize(publicKey))); | ||
async exportById< | ||
T = Ed25519Keypair | Secp256k1Keypair | X25519Keypair | ByteKey | ||
T = Ed25519Keypair | Secp256k1Keypair | X25519Keypair | ByteKey, | ||
>(id: Uint8Array, type: Constructor<T>): Promise<T | undefined> { | ||
@@ -89,3 +93,3 @@ const key = await this.properties.store.get(toBase64(id)); | ||
key, | ||
maybeConvert ? (Keypair as Constructor<T>) : type | ||
maybeConvert ? (Keypair as Constructor<T>) : type, | ||
); | ||
@@ -92,0 +96,0 @@ |
@@ -1,14 +0,14 @@ | ||
import { | ||
import { type AbstractType } from "@dao-xyz/borsh"; | ||
import type { | ||
ByteKey, | ||
Ed25519Keypair, | ||
X25519Keypair, | ||
Ed25519PublicKey, | ||
Keypair, | ||
Ed25519PublicKey, | ||
X25519PublicKey, | ||
ByteKey, | ||
PublicKeyEncryptionKey, | ||
PublicSignKey, | ||
Secp256k1Keypair, | ||
Secp256k1PublicKey, | ||
PublicKeyEncryptionKey, | ||
PublicSignKey | ||
X25519Keypair, | ||
X25519PublicKey, | ||
} from "@peerbit/crypto"; | ||
import { AbstractType } from "@dao-xyz/borsh"; | ||
@@ -33,3 +33,3 @@ export type KeypairFromPublicKey<T> = T extends X25519PublicKey | ||
import( | ||
parameters: (KeypairParameters | KeyParameters) & { id: Uint8Array } | ||
parameters: (KeypairParameters | KeyParameters) & { id: Uint8Array }, | ||
): Promise<void>; | ||
@@ -45,5 +45,5 @@ | ||
| PublicKeyEncryptionKey, | ||
Q = KeypairFromPublicKey<T> | ||
Q = KeypairFromPublicKey<T>, | ||
>( | ||
publicKey: T | ||
publicKey: T, | ||
): Promise<Q | undefined>; | ||
@@ -55,7 +55,7 @@ | ||
exportById< | ||
T extends Ed25519Keypair | Secp256k1Keypair | X25519Keypair | ByteKey | ||
T extends Ed25519Keypair | Secp256k1Keypair | X25519Keypair | ByteKey, | ||
>( | ||
id: Uint8Array, | ||
type: AbstractType<T> | ||
type: AbstractType<T>, | ||
): Promise<T | undefined>; | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
11
0
248
14959
2
1
+ Added@libp2p/crypto@4.1.9(transitive)
+ Added@libp2p/interface@1.7.0(transitive)
+ Added@libp2p/peer-id@4.2.4(transitive)
+ Added@peerbit/any-store@2.1.0-2b760c3(transitive)
+ Added@peerbit/any-store-interface@1.0.0-2b760c3(transitive)
+ Added@peerbit/any-store-opfs@1.0.0-2b760c3(transitive)
+ Added@peerbit/cache@2.1.0-2b760c3(transitive)
+ Added@peerbit/crypto@2.3.0-2b760c3(transitive)
+ Added@peerbit/logger@1.0.3-2b760c3(transitive)
+ Added@peerbit/time@2.0.7-2b760c3(transitive)
+ Addeduuid@9.0.1(transitive)
- Removed@libp2p/crypto@5.0.12(transitive)
- Removed@libp2p/interface@2.6.0(transitive)
- Removed@libp2p/peer-id@5.0.13(transitive)
- Removed@peerbit/any-store@2.1.5(transitive)
- Removed@peerbit/any-store-interface@1.0.0(transitive)
- Removed@peerbit/any-store-opfs@1.0.5(transitive)
- Removed@peerbit/cache@2.1.2(transitive)
- Removed@peerbit/crypto@2.3.5(transitive)
- Removed@peerbit/logger@1.0.3(transitive)
- Removed@peerbit/time@2.0.8(transitive)
- Removeduuid@10.0.0(transitive)