applesauce-signers 1.0.0 → 1.2.0
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/README.md +1 -1
- package/dist/__tests__/exports.test.js +22 -0
- package/dist/helpers/__tests__/exports.test.d.ts +1 -0
- package/dist/helpers/__tests__/exports.test.js +11 -0
- package/dist/signers/__tests__/exports.test.d.ts +1 -0
- package/dist/signers/__tests__/exports.test.js +21 -0
- package/dist/signers/__tests__/nostr-connect-signer.test.d.ts +1 -0
- package/dist/signers/{nostr-connect-signer.test.js → __tests__/nostr-connect-signer.test.js} +2 -2
- package/dist/signers/nostr-connect-signer.d.ts +1 -1
- package/dist/signers/serial-port-signer.d.ts +1 -1
- package/dist/signers/serial-port-signer.js +4 -4
- package/package.json +2 -2
- package/dist/logger.d.ts +0 -2
- package/dist/logger.js +0 -2
- /package/dist/{signers/nostr-connect-signer.test.d.ts → __tests__/exports.test.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ For detailed documentation and API reference, see:
|
|
|
8
8
|
|
|
9
9
|
- [Signers Documentation](https://hzrd149.github.io/applesauce/signers/signers.html)
|
|
10
10
|
- [Nostr Connect Documentation](https://hzrd149.github.io/applesauce/signers/nostr-connect.html)
|
|
11
|
-
- [API Reference](https://hzrd149.github.io/applesauce/typedoc/modules/
|
|
11
|
+
- [API Reference](https://hzrd149.github.io/applesauce/typedoc/modules/applesauce-signers.html)
|
|
12
12
|
|
|
13
13
|
## Available Signers
|
|
14
14
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import * as exports from "../index.js";
|
|
3
|
+
describe("exports", () => {
|
|
4
|
+
it("should export the expected functions", () => {
|
|
5
|
+
expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
|
|
6
|
+
[
|
|
7
|
+
"AmberClipboardSigner",
|
|
8
|
+
"ExtensionMissingError",
|
|
9
|
+
"ExtensionSigner",
|
|
10
|
+
"Helpers",
|
|
11
|
+
"NostrConnectMethod",
|
|
12
|
+
"NostrConnectSigner",
|
|
13
|
+
"PasswordSigner",
|
|
14
|
+
"Permission",
|
|
15
|
+
"ReadonlySigner",
|
|
16
|
+
"SerialPortSigner",
|
|
17
|
+
"SimpleSigner",
|
|
18
|
+
"isErrorResponse",
|
|
19
|
+
]
|
|
20
|
+
`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import * as exports from "../index.js";
|
|
3
|
+
describe("exports", () => {
|
|
4
|
+
it("should export the expected functions", () => {
|
|
5
|
+
expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
|
|
6
|
+
[
|
|
7
|
+
"isNIP04",
|
|
8
|
+
]
|
|
9
|
+
`);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import * as exports from "../index.js";
|
|
3
|
+
describe("exports", () => {
|
|
4
|
+
it("should export the expected functions", () => {
|
|
5
|
+
expect(Object.keys(exports).sort()).toMatchInlineSnapshot(`
|
|
6
|
+
[
|
|
7
|
+
"AmberClipboardSigner",
|
|
8
|
+
"ExtensionMissingError",
|
|
9
|
+
"ExtensionSigner",
|
|
10
|
+
"NostrConnectMethod",
|
|
11
|
+
"NostrConnectSigner",
|
|
12
|
+
"PasswordSigner",
|
|
13
|
+
"Permission",
|
|
14
|
+
"ReadonlySigner",
|
|
15
|
+
"SerialPortSigner",
|
|
16
|
+
"SimpleSigner",
|
|
17
|
+
"isErrorResponse",
|
|
18
|
+
]
|
|
19
|
+
`);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/signers/{nostr-connect-signer.test.js → __tests__/nostr-connect-signer.test.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { NostrConnectSigner } from "
|
|
3
|
-
import { SimpleSigner } from "
|
|
2
|
+
import { NostrConnectSigner } from "../nostr-connect-signer.js";
|
|
3
|
+
import { SimpleSigner } from "../simple-signer.js";
|
|
4
4
|
describe("NostrConnectSigner", () => {
|
|
5
5
|
describe("connection", () => {
|
|
6
6
|
it("should call subscription method with filters", async () => {
|
|
@@ -83,7 +83,7 @@ type Subscribable<T extends unknown> = {
|
|
|
83
83
|
subscribe: (observer: Partial<Observer<T>>) => Unsubscribable;
|
|
84
84
|
};
|
|
85
85
|
export type NostrSubscriptionMethod = (relays: string[], filters: Filter[]) => Subscribable<NostrEvent>;
|
|
86
|
-
export type NostrPublishMethod = (relays: string[], event: NostrEvent) =>
|
|
86
|
+
export type NostrPublishMethod = (relays: string[], event: NostrEvent) => any | Promise<any>;
|
|
87
87
|
export type NostrConnectAppMetadata = {
|
|
88
88
|
name?: string;
|
|
89
89
|
image?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventTemplate, verifyEvent } from "nostr-tools";
|
|
2
1
|
import { Deferred } from "applesauce-core/promise";
|
|
2
|
+
import { EventTemplate, verifyEvent } from "nostr-tools";
|
|
3
3
|
import { Nip07Interface } from "../nip-07.js";
|
|
4
4
|
type Callback = () => void;
|
|
5
5
|
type DeviceOpts = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="@types/dom-serial" />
|
|
2
|
-
import {
|
|
3
|
-
import { base64 } from "@scure/base";
|
|
4
|
-
import { randomBytes, hexToBytes, bytesToHex } from "@noble/hashes/utils";
|
|
2
|
+
import { bytesToHex, hexToBytes, randomBytes } from "@noble/hashes/utils";
|
|
5
3
|
import { Point } from "@noble/secp256k1";
|
|
4
|
+
import { base64 } from "@scure/base";
|
|
5
|
+
import { logger } from "applesauce-core";
|
|
6
6
|
import { createDefer } from "applesauce-core/promise";
|
|
7
|
-
import {
|
|
7
|
+
import { getEventHash, verifyEvent } from "nostr-tools";
|
|
8
8
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
9
9
|
function xOnlyToXY(p) {
|
|
10
10
|
return Point.fromHex(p).toHex().substring(2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-signers",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Signer classes for applesauce",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@noble/hashes": "^1.7.1",
|
|
37
37
|
"@noble/secp256k1": "^1.7.1",
|
|
38
38
|
"@scure/base": "^1.2.4",
|
|
39
|
-
"applesauce-core": "^1.
|
|
39
|
+
"applesauce-core": "^1.2.0",
|
|
40
40
|
"debug": "^4.4.0",
|
|
41
41
|
"nanoid": "^5.0.9",
|
|
42
42
|
"nostr-tools": "^2.10.4"
|
package/dist/logger.d.ts
DELETED
package/dist/logger.js
DELETED
|
File without changes
|