New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@peerbit/keychain

Package Overview
Dependencies
Maintainers
0
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peerbit/keychain - npm Package Compare versions

Comparing version 1.0.17 to 1.0.18-5901172

dist/src/index.d.ts

96

package.json
{
"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-5901172",
"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-5901172",
"@peerbit/any-store": "2.1.0-5901172"
}
}

@@ -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>;
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc