applesauce-accounts 0.0.0-next-20250124224944 → 0.0.0-next-20250124230519
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/dist/accounts/common.js +4 -4
- package/dist/accounts/extension-account.d.ts +1 -1
- package/dist/accounts/extension-account.js +1 -1
- package/dist/accounts/password-account.d.ts +1 -1
- package/dist/accounts/password-account.js +1 -1
- package/dist/accounts/readonly-account.d.ts +1 -1
- package/dist/accounts/readonly-account.js +1 -1
- package/dist/accounts/serial-port-account.d.ts +1 -1
- package/dist/accounts/serial-port-account.js +1 -1
- package/dist/accounts/simple-account.d.ts +1 -1
- package/dist/accounts/simple-account.js +1 -1
- package/package.json +2 -2
package/dist/accounts/common.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import ExtensionAccount from "./extension-account.js";
|
|
2
|
-
import PasswordAccount from "./password-account.js";
|
|
3
|
-
import ReadonlyAccount from "./readonly-account.js";
|
|
4
|
-
import SimpleAccount from "./simple-account.js";
|
|
1
|
+
import { ExtensionAccount } from "./extension-account.js";
|
|
2
|
+
import { PasswordAccount } from "./password-account.js";
|
|
3
|
+
import { ReadonlyAccount } from "./readonly-account.js";
|
|
4
|
+
import { SimpleAccount } from "./simple-account.js";
|
|
5
5
|
/** Registers the most common account types to a account manager */
|
|
6
6
|
export function registerCommonAccountTypes(manager) {
|
|
7
7
|
manager.registerType(ExtensionAccount);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExtensionSigner } from "applesauce-signer/signers/extension-signer";
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
3
|
import { SerializedAccount } from "../types.js";
|
|
4
|
-
export
|
|
4
|
+
export declare class ExtensionAccount<Metadata extends unknown> extends BaseAccount<ExtensionSigner, void, Metadata> {
|
|
5
5
|
signer: ExtensionSigner;
|
|
6
6
|
static type: string;
|
|
7
7
|
constructor(pubkey: string, signer: ExtensionSigner);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExtensionSigner } from "applesauce-signer/signers/extension-signer";
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
|
-
export
|
|
3
|
+
export class ExtensionAccount extends BaseAccount {
|
|
4
4
|
signer;
|
|
5
5
|
static type = "extension";
|
|
6
6
|
constructor(pubkey, signer) {
|
|
@@ -4,7 +4,7 @@ import { SerializedAccount } from "../types.js";
|
|
|
4
4
|
type SignerData = {
|
|
5
5
|
ncryptsec: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export declare class PasswordAccount<Metadata extends unknown> extends BaseAccount<PasswordSigner, SignerData, Metadata> {
|
|
8
8
|
static type: string;
|
|
9
9
|
get unlocked(): boolean;
|
|
10
10
|
/** called when PasswordAccount.unlock is called without a password */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PasswordSigner } from "applesauce-signer/signers/password-signer";
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
|
-
export
|
|
3
|
+
export class PasswordAccount extends BaseAccount {
|
|
4
4
|
static type = "ncryptsec";
|
|
5
5
|
get unlocked() {
|
|
6
6
|
return this.signer.unlocked;
|
|
@@ -2,7 +2,7 @@ import { ReadonlySigner } from "applesauce-signer/signers/readonly-signer";
|
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
3
|
import { SerializedAccount } from "../types.js";
|
|
4
4
|
/** An account that cannot sign or encrypt anything */
|
|
5
|
-
export
|
|
5
|
+
export declare class ReadonlyAccount<Metadata extends unknown> extends BaseAccount<ReadonlySigner, void, Metadata> {
|
|
6
6
|
static type: string;
|
|
7
7
|
toJSON(): {
|
|
8
8
|
type: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReadonlySigner } from "applesauce-signer/signers/readonly-signer";
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
3
|
/** An account that cannot sign or encrypt anything */
|
|
4
|
-
export
|
|
4
|
+
export class ReadonlyAccount extends BaseAccount {
|
|
5
5
|
static type = "readonly";
|
|
6
6
|
toJSON() {
|
|
7
7
|
return {
|
|
@@ -2,7 +2,7 @@ import { SerialPortSigner } from "applesauce-signer/signers/serial-port-signer";
|
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
3
|
import { SerializedAccount } from "../types.js";
|
|
4
4
|
/** An account for SerialPortSigner */
|
|
5
|
-
export
|
|
5
|
+
export declare class SerialPortAccount<Metadata extends unknown> extends BaseAccount<SerialPortSigner, void, Metadata> {
|
|
6
6
|
static type: string;
|
|
7
7
|
unlock(): Promise<boolean>;
|
|
8
8
|
toJSON(): SerializedAccount<void, Metadata>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SerialPortSigner } from "applesauce-signer/signers/serial-port-signer";
|
|
2
2
|
import { BaseAccount } from "../account.js";
|
|
3
3
|
/** An account for SerialPortSigner */
|
|
4
|
-
export
|
|
4
|
+
export class SerialPortAccount extends BaseAccount {
|
|
5
5
|
static type = "serial-port";
|
|
6
6
|
async unlock() {
|
|
7
7
|
try {
|
|
@@ -4,7 +4,7 @@ import { SerializedAccount } from "../types.js";
|
|
|
4
4
|
type SignerData = {
|
|
5
5
|
key: string;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export declare class SimpleAccount<Metadata extends unknown> extends BaseAccount<SimpleSigner, SignerData, Metadata> {
|
|
8
8
|
static type: string;
|
|
9
9
|
toJSON(): SerializedAccount<SignerData, Metadata>;
|
|
10
10
|
static fromJSON<Metadata extends unknown>(json: SerializedAccount<SignerData, Metadata>): SimpleAccount<Metadata>;
|
|
@@ -2,7 +2,7 @@ import { getPublicKey } from "nostr-tools";
|
|
|
2
2
|
import { SimpleSigner } from "applesauce-signer/signers/simple-signer";
|
|
3
3
|
import { bytesToHex, hexToBytes } from "@noble/hashes/utils";
|
|
4
4
|
import { BaseAccount } from "../account.js";
|
|
5
|
-
export
|
|
5
|
+
export class SimpleAccount extends BaseAccount {
|
|
6
6
|
static type = "nsec";
|
|
7
7
|
toJSON() {
|
|
8
8
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-accounts",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250124230519",
|
|
4
4
|
"description": "A simple nostr account management system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@noble/hashes": "^1.5.0",
|
|
35
|
-
"applesauce-signer": "0.0.0-next-
|
|
35
|
+
"applesauce-signer": "0.0.0-next-20250124230519",
|
|
36
36
|
"nanoid": "^5.0.9",
|
|
37
37
|
"nostr-tools": "^2.10.3",
|
|
38
38
|
"rxjs": "^7.8.1"
|