@welshman/app 0.12.6 → 0.13.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/dist/app/src/plugins/base.d.ts +17 -23
- package/dist/app/src/plugins/base.d.ts.map +1 -1
- package/dist/app/src/plugins/base.js +23 -34
- package/dist/app/src/plugins/base.js.map +1 -1
- package/dist/app/src/plugins/plaintext.d.ts +6 -2
- package/dist/app/src/plugins/plaintext.d.ts.map +1 -1
- package/dist/app/src/plugins/plaintext.js +34 -14
- package/dist/app/src/plugins/plaintext.js.map +1 -1
- package/dist/app/src/plugins/publisher.d.ts +9 -5
- package/dist/app/src/plugins/publisher.d.ts.map +1 -1
- package/dist/app/src/plugins/publisher.js +108 -75
- package/dist/app/src/plugins/publisher.js.map +1 -1
- package/dist/app/src/plugins/wraps.d.ts +5 -1
- package/dist/app/src/plugins/wraps.d.ts.map +1 -1
- package/dist/app/src/plugins/wraps.js +6 -10
- package/dist/app/src/plugins/wraps.js.map +1 -1
- package/dist/app/src/policy.d.ts.map +1 -1
- package/dist/app/src/policy.js +4 -1
- package/dist/app/src/policy.js.map +1 -1
- package/dist/app/src/user.d.ts +2 -2
- package/dist/app/src/user.d.ts.map +1 -1
- package/dist/app/src/user.js.map +1 -1
- package/dist/domain/src/core/ListWriter.d.ts +6 -6
- package/dist/domain/src/kinds/Bolt12Offer.d.ts.map +1 -1
- package/dist/domain/src/kinds/Bolt12Offer.js +10 -9
- package/dist/domain/src/kinds/Bolt12Offer.js.map +1 -1
- package/dist/domain/src/kinds/Bolt12Zap.d.ts +6 -11
- package/dist/domain/src/kinds/Bolt12Zap.d.ts.map +1 -1
- package/dist/domain/src/kinds/Bolt12Zap.js +77 -105
- package/dist/domain/src/kinds/Bolt12Zap.js.map +1 -1
- package/dist/domain/src/kinds/Bolt12ZapIntent.d.ts +2 -0
- package/dist/domain/src/kinds/Bolt12ZapIntent.d.ts.map +1 -1
- package/dist/domain/src/kinds/Bolt12ZapIntent.js +31 -20
- package/dist/domain/src/kinds/Bolt12ZapIntent.js.map +1 -1
- package/dist/feeds/src/request.d.ts.map +1 -1
- package/dist/feeds/src/request.js +14 -5
- package/dist/feeds/src/request.js.map +1 -1
- package/dist/lib/src/TaskQueue.d.ts.map +1 -1
- package/dist/lib/src/TaskQueue.js +8 -2
- package/dist/lib/src/TaskQueue.js.map +1 -1
- package/dist/net/src/policy.d.ts.map +1 -1
- package/dist/net/src/policy.js +11 -3
- package/dist/net/src/policy.js.map +1 -1
- package/dist/net/src/repository.d.ts +18 -15
- package/dist/net/src/repository.d.ts.map +1 -1
- package/dist/net/src/repository.js +69 -78
- package/dist/net/src/repository.js.map +1 -1
- package/dist/net/src/wrapManager.d.ts +0 -2
- package/dist/net/src/wrapManager.d.ts.map +1 -1
- package/dist/net/src/wrapManager.js +8 -23
- package/dist/net/src/wrapManager.js.map +1 -1
- package/dist/signer/src/index.d.ts +1 -0
- package/dist/signer/src/index.d.ts.map +1 -1
- package/dist/signer/src/index.js +1 -0
- package/dist/signer/src/index.js.map +1 -1
- package/dist/signer/src/nip59.d.ts +13 -6
- package/dist/signer/src/nip59.d.ts.map +1 -1
- package/dist/signer/src/nip59.js +38 -19
- package/dist/signer/src/nip59.js.map +1 -1
- package/dist/signer/src/queue.d.ts +21 -0
- package/dist/signer/src/queue.d.ts.map +1 -0
- package/dist/signer/src/queue.js +40 -0
- package/dist/signer/src/queue.js.map +1 -0
- package/dist/signer/src/signers/nip01.d.ts +14 -2
- package/dist/signer/src/signers/nip01.d.ts.map +1 -1
- package/dist/signer/src/signers/nip01.js +6 -2
- package/dist/signer/src/signers/nip01.js.map +1 -1
- package/dist/signer/src/signers/nip07.d.ts +9 -9
- package/dist/signer/src/signers/nip07.d.ts.map +1 -1
- package/dist/signer/src/signers/nip07.js +15 -27
- package/dist/signer/src/signers/nip07.js.map +1 -1
- package/dist/signer/src/signers/nip46.d.ts +7 -3
- package/dist/signer/src/signers/nip46.d.ts.map +1 -1
- package/dist/signer/src/signers/nip46.js +12 -8
- package/dist/signer/src/signers/nip46.js.map +1 -1
- package/dist/signer/src/signers/nip55.d.ts +7 -7
- package/dist/signer/src/signers/nip55.d.ts.map +1 -1
- package/dist/signer/src/signers/nip55.js +33 -40
- package/dist/signer/src/signers/nip55.js.map +1 -1
- package/dist/signer/src/util.d.ts +27 -15
- package/dist/signer/src/util.d.ts.map +1 -1
- package/dist/signer/src/util.js +47 -14
- package/dist/signer/src/util.js.map +1 -1
- package/dist/store/src/repository.d.ts +5 -0
- package/dist/store/src/repository.d.ts.map +1 -1
- package/dist/store/src/repository.js +115 -96
- package/dist/store/src/repository.js.map +1 -1
- package/dist/util/src/Bolt12.d.ts.map +1 -1
- package/dist/util/src/Bolt12.js +11 -8
- package/dist/util/src/Bolt12.js.map +1 -1
- package/dist/util/src/Events.d.ts +1 -0
- package/dist/util/src/Events.d.ts.map +1 -1
- package/dist/util/src/Events.js +10 -1
- package/dist/util/src/Events.js.map +1 -1
- package/dist/util/src/Lightning.d.ts +1 -0
- package/dist/util/src/Lightning.d.ts.map +1 -1
- package/dist/util/src/Lightning.js +1 -0
- package/dist/util/src/Lightning.js.map +1 -1
- package/package.json +15 -15
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { noop } from "@welshman/lib";
|
|
2
1
|
import { hash, own, Pubkey } from "@welshman/util";
|
|
3
|
-
import {
|
|
2
|
+
import { SignerQueue } from "../queue.js";
|
|
4
3
|
let plugin;
|
|
5
4
|
/**
|
|
6
5
|
* Register the NIP-55 plugin. Capacitor apps should call this once at startup:
|
|
@@ -25,62 +24,56 @@ const makeRequestId = () => `${Date.now()}-${Math.random().toString(36).slice(2)
|
|
|
25
24
|
export class Nip55Signer {
|
|
26
25
|
packageName;
|
|
27
26
|
#pubkey;
|
|
28
|
-
#
|
|
27
|
+
#queue = new SignerQueue();
|
|
29
28
|
#setup;
|
|
30
29
|
constructor(packageName, pubkey) {
|
|
31
30
|
this.packageName = packageName;
|
|
32
31
|
this.#pubkey = pubkey;
|
|
33
32
|
}
|
|
34
|
-
#then = async (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.#setup
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Swallow the result either way — a failed call must not poison the lock
|
|
49
|
-
this.#lock = promise.then(noop, noop);
|
|
50
|
-
return promise;
|
|
51
|
-
};
|
|
52
|
-
#crypt = async (method, pubkey, message) => {
|
|
33
|
+
#then = (f, options) => this.#queue.push(async () => {
|
|
34
|
+
const nip55 = plugin;
|
|
35
|
+
if (!nip55)
|
|
36
|
+
throw new Error("Nip55 is not enabled");
|
|
37
|
+
if (!this.#setup) {
|
|
38
|
+
this.#setup = nip55.setPackageName(this.packageName);
|
|
39
|
+
this.#setup.catch(() => {
|
|
40
|
+
this.#setup = undefined;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
await this.#setup;
|
|
44
|
+
return f(nip55);
|
|
45
|
+
}, options);
|
|
46
|
+
#crypt = async (method, pubkey, message, options) => {
|
|
53
47
|
if (!this.#pubkey) {
|
|
54
|
-
await this.getPubkey();
|
|
48
|
+
await this.getPubkey(options);
|
|
55
49
|
}
|
|
56
50
|
return this.#then(async (plugin) => {
|
|
57
51
|
const { result } = await plugin[method](this.packageName, message, makeRequestId(), pubkey, this.#pubkey);
|
|
58
52
|
return result;
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
getPubkey = async () => {
|
|
62
|
-
return this.#then(async (plugin) => {
|
|
63
|
-
if (!this.#pubkey) {
|
|
64
|
-
const { npub } = await plugin.getPublicKey(this.packageName);
|
|
65
|
-
this.#pubkey = Pubkey.from(npub).toString();
|
|
66
|
-
}
|
|
67
|
-
return this.#pubkey;
|
|
68
|
-
});
|
|
53
|
+
}, options);
|
|
69
54
|
};
|
|
70
|
-
|
|
55
|
+
// The pubkey is a request of its own, so it inherits the options of whatever asked for it
|
|
56
|
+
getPubkey = (options = {}) => this.#then(async (plugin) => {
|
|
57
|
+
if (!this.#pubkey) {
|
|
58
|
+
const { npub } = await plugin.getPublicKey(this.packageName);
|
|
59
|
+
this.#pubkey = Pubkey.from(npub).toString();
|
|
60
|
+
}
|
|
61
|
+
return this.#pubkey;
|
|
62
|
+
}, options);
|
|
63
|
+
sign = (template, options = {}) => this.getPubkey(options).then(pubkey => {
|
|
71
64
|
const hashedEvent = hash(own(template, pubkey));
|
|
72
65
|
return this.#then(async (plugin) => {
|
|
73
66
|
const { event: json } = await plugin.signEvent(this.packageName, JSON.stringify({ sig: "", ...hashedEvent }), hashedEvent.id, this.#pubkey);
|
|
74
67
|
return JSON.parse(json);
|
|
75
|
-
});
|
|
76
|
-
})
|
|
68
|
+
}, options);
|
|
69
|
+
});
|
|
77
70
|
nip04 = {
|
|
78
|
-
encrypt: (pubkey, message) => this.#crypt("nip04Encrypt", pubkey, message),
|
|
79
|
-
decrypt: (pubkey, message) => this.#crypt("nip04Decrypt", pubkey, message),
|
|
71
|
+
encrypt: (pubkey, message, options = {}) => this.#crypt("nip04Encrypt", pubkey, message, options),
|
|
72
|
+
decrypt: (pubkey, message, options = {}) => this.#crypt("nip04Decrypt", pubkey, message, options),
|
|
80
73
|
};
|
|
81
74
|
nip44 = {
|
|
82
|
-
encrypt: (pubkey, message) => this.#crypt("nip44Encrypt", pubkey, message),
|
|
83
|
-
decrypt: (pubkey, message) => this.#crypt("nip44Decrypt", pubkey, message),
|
|
75
|
+
encrypt: (pubkey, message, options = {}) => this.#crypt("nip44Encrypt", pubkey, message, options),
|
|
76
|
+
decrypt: (pubkey, message, options = {}) => this.#crypt("nip44Decrypt", pubkey, message, options),
|
|
84
77
|
};
|
|
85
78
|
}
|
|
86
79
|
//# sourceMappingURL=nip55.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nip55.js","sourceRoot":"","sources":["../../../../../signer/src/signers/nip55.ts"],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,OAAe,EAAE,UAAyB,EAAE,EAAE,EAAE,CACxE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;QACvD,OAAO,EAAE,CAAC,MAAc,EAAE,OAAe,EAAE,UAAyB,EAAE,EAAE,EAAE,CACxE,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;KACxD,CAAA;CACF"}
|
|
@@ -16,41 +16,53 @@ export declare const nip44: {
|
|
|
16
16
|
encrypt: (pubkey: string, secret: string, m: string) => string;
|
|
17
17
|
decrypt: (pubkey: string, secret: string, m: string) => string;
|
|
18
18
|
};
|
|
19
|
-
export type
|
|
20
|
-
export type SignOptions = {
|
|
19
|
+
export type SignerOptions = {
|
|
21
20
|
signal?: AbortSignal;
|
|
21
|
+
/** Requests to one signer are answered highest first, 0 by default, so bulk work behind the
|
|
22
|
+
* user can ask for a negative one and leave the user's own requests ahead of it. */
|
|
23
|
+
priority?: number;
|
|
22
24
|
};
|
|
23
|
-
export type
|
|
24
|
-
export type Encrypt = (pubkey: string, message: string) => Promise<string>;
|
|
25
|
-
export type Decrypt = (pubkey: string, message: string) => Promise<string>;
|
|
25
|
+
export type Sign = (event: StampedEvent, options?: SignerOptions) => Promise<SignedEvent>;
|
|
26
|
+
export type Encrypt = (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
27
|
+
export type Decrypt = (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
26
28
|
export type EncryptionImplementation = {
|
|
27
29
|
encrypt: Encrypt;
|
|
28
30
|
decrypt: Decrypt;
|
|
29
31
|
};
|
|
30
32
|
export interface ISigner {
|
|
31
|
-
sign:
|
|
33
|
+
sign: Sign;
|
|
32
34
|
nip04: EncryptionImplementation;
|
|
33
35
|
nip44: EncryptionImplementation;
|
|
34
|
-
getPubkey: () => Promise<string>;
|
|
36
|
+
getPubkey: (options?: SignerOptions) => Promise<string>;
|
|
35
37
|
cleanup?: () => Promise<void>;
|
|
36
38
|
}
|
|
37
|
-
export declare const decrypt: (signer: ISigner, pubkey: string, message: string) => Promise<string>;
|
|
39
|
+
export declare const decrypt: (signer: ISigner, pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
38
40
|
export type SignerMethodWrapper = <T>(method: string, thunk: () => Promise<T>, args: unknown[]) => Promise<T>;
|
|
39
41
|
export declare class WrappedSigner extends Emitter implements ISigner {
|
|
40
42
|
readonly signer: ISigner;
|
|
41
43
|
readonly wrapMethod: SignerMethodWrapper;
|
|
42
44
|
constructor(signer: ISigner, wrapMethod: SignerMethodWrapper);
|
|
43
|
-
sign: (event: StampedEvent, options?:
|
|
44
|
-
getPubkey: () => Promise<string>;
|
|
45
|
+
sign: (event: StampedEvent, options?: SignerOptions) => Promise<SignedEvent>;
|
|
46
|
+
getPubkey: (options?: SignerOptions) => Promise<string>;
|
|
45
47
|
nip04: {
|
|
46
|
-
encrypt: (pubkey: string, message: string) => Promise<string>;
|
|
47
|
-
decrypt: (pubkey: string, message: string) => Promise<string>;
|
|
48
|
+
encrypt: (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
49
|
+
decrypt: (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
48
50
|
};
|
|
49
51
|
nip44: {
|
|
50
|
-
encrypt: (pubkey: string, message: string) => Promise<string>;
|
|
51
|
-
decrypt: (pubkey: string, message: string) => Promise<string>;
|
|
52
|
+
encrypt: (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
53
|
+
decrypt: (pubkey: string, message: string, options?: SignerOptions) => Promise<string>;
|
|
52
54
|
};
|
|
53
55
|
cleanup(): Promise<void>;
|
|
54
56
|
}
|
|
55
|
-
export declare const
|
|
57
|
+
export declare const SIGNER_TIMEOUT = 30000;
|
|
58
|
+
/**
|
|
59
|
+
* How long welshman waits for one request to a signer, rather than how long that request
|
|
60
|
+
* runs — an extension, a native app and a bunker all answer when they answer, and offer
|
|
61
|
+
* no way to recall a request. The caller's `AbortSignal` and `SIGNER_TIMEOUT` each give up
|
|
62
|
+
* on it, so the signer may still answer afterwards with nobody listening.
|
|
63
|
+
*
|
|
64
|
+
* It starts `request` itself, so a request whose signal is already aborted is never sent, and
|
|
65
|
+
* one that throws rather than rejecting still settles.
|
|
66
|
+
*/
|
|
67
|
+
export declare const signerCall: <T>(request: () => Promise<T>, { signal }?: SignerOptions) => Promise<T>;
|
|
56
68
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../signer/src/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../signer/src/util.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAsB,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAExD,eAAO,MAAM,KAAK;gBACJ,MAAM;sBACA,MAAM,UAAU,MAAM,KAAK,MAAM;sBACjC,MAAM,UAAU,MAAM,KAAK,MAAM;CACpD,CAAA;AAED,eAAO,MAAM,KAAK;;;;;;;;sBAOE,MAAM,UAAU,MAAM,KAAK,MAAM;sBAEjC,MAAM,UAAU,MAAM,KAAK,MAAM;CAEpD,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;wFACoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AAEzF,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,KA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qB,MAAM,WAAW,MAAM,YAAW,aAAa;0BAM/C,MAAM,WAAW,MAAM,YAAW,aAAa;MAMxE;IAEK,OAAO;CAGd;AAGD,eAAO,MAAM,cAAc,QAAS,CAAA;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,SAAS,MAAM,OAAO,CAAC,CAAC,CAAC,EAAE,aAAU,aAAkB,KA0BlE,OAAO,CAAC,CAAC,CAC3B,CAAA"}
|
package/dist/signer/src/util.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { hexToBytes } from "@noble/hashes/utils.js";
|
|
2
2
|
import * as nt04 from "nostr-tools/nip04";
|
|
3
3
|
import * as nt44 from "nostr-tools/nip44";
|
|
4
|
-
import { Emitter, cached } from "@welshman/lib";
|
|
4
|
+
import { Emitter, cached, defer, noop } from "@welshman/lib";
|
|
5
5
|
export const nip04 = {
|
|
6
6
|
detect: (m) => m.includes("?iv="),
|
|
7
7
|
encrypt: (pubkey, secret, m) => nt04.encrypt(secret, pubkey, m),
|
|
@@ -16,9 +16,9 @@ export const nip44 = {
|
|
|
16
16
|
encrypt: (pubkey, secret, m) => nt44.v2.encrypt(m, nip44.getSharedSecret(secret, pubkey)),
|
|
17
17
|
decrypt: (pubkey, secret, m) => nt44.v2.decrypt(m, nip44.getSharedSecret(secret, pubkey)),
|
|
18
18
|
};
|
|
19
|
-
export const decrypt = async (signer, pubkey, message) => nip04.detect(message)
|
|
20
|
-
? signer.nip04.decrypt(pubkey, message)
|
|
21
|
-
: signer.nip44.decrypt(pubkey, message);
|
|
19
|
+
export const decrypt = async (signer, pubkey, message, options) => nip04.detect(message)
|
|
20
|
+
? signer.nip04.decrypt(pubkey, message, options)
|
|
21
|
+
: signer.nip44.decrypt(pubkey, message, options);
|
|
22
22
|
export class WrappedSigner extends Emitter {
|
|
23
23
|
signer;
|
|
24
24
|
wrapMethod;
|
|
@@ -28,34 +28,67 @@ export class WrappedSigner extends Emitter {
|
|
|
28
28
|
this.wrapMethod = wrapMethod;
|
|
29
29
|
}
|
|
30
30
|
sign = (event, options = {}) => this.wrapMethod("sign", () => this.signer.sign(event, options), [event, options]);
|
|
31
|
-
getPubkey = () => this.wrapMethod("getPubkey", () => this.signer.getPubkey(), []);
|
|
31
|
+
getPubkey = (options = {}) => this.wrapMethod("getPubkey", () => this.signer.getPubkey(options), [options]);
|
|
32
32
|
nip04 = {
|
|
33
|
-
encrypt: async (pubkey, message) => this.wrapMethod("nip04.encrypt", () => this.signer.nip04.encrypt(pubkey, message), [
|
|
33
|
+
encrypt: async (pubkey, message, options = {}) => this.wrapMethod("nip04.encrypt", () => this.signer.nip04.encrypt(pubkey, message, options), [
|
|
34
34
|
pubkey,
|
|
35
35
|
message,
|
|
36
|
+
options,
|
|
36
37
|
]),
|
|
37
|
-
decrypt: async (pubkey, message) => this.wrapMethod("nip04.decrypt", () => this.signer.nip04.decrypt(pubkey, message), [
|
|
38
|
+
decrypt: async (pubkey, message, options = {}) => this.wrapMethod("nip04.decrypt", () => this.signer.nip04.decrypt(pubkey, message, options), [
|
|
38
39
|
pubkey,
|
|
39
40
|
message,
|
|
41
|
+
options,
|
|
40
42
|
]),
|
|
41
43
|
};
|
|
42
44
|
nip44 = {
|
|
43
|
-
encrypt: async (pubkey, message) => this.wrapMethod("nip44.encrypt", () => this.signer.nip44.encrypt(pubkey, message), [
|
|
45
|
+
encrypt: async (pubkey, message, options = {}) => this.wrapMethod("nip44.encrypt", () => this.signer.nip44.encrypt(pubkey, message, options), [
|
|
44
46
|
pubkey,
|
|
45
47
|
message,
|
|
48
|
+
options,
|
|
46
49
|
]),
|
|
47
|
-
decrypt: async (pubkey, message) => this.wrapMethod("nip44.decrypt", () => this.signer.nip44.decrypt(pubkey, message), [
|
|
50
|
+
decrypt: async (pubkey, message, options = {}) => this.wrapMethod("nip44.decrypt", () => this.signer.nip44.decrypt(pubkey, message, options), [
|
|
48
51
|
pubkey,
|
|
49
52
|
message,
|
|
53
|
+
options,
|
|
50
54
|
]),
|
|
51
55
|
};
|
|
52
56
|
async cleanup() {
|
|
53
57
|
await this.signer.cleanup?.();
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
// A signer that never answers would otherwise hold its caller open forever
|
|
61
|
+
export const SIGNER_TIMEOUT = 30_000;
|
|
62
|
+
/**
|
|
63
|
+
* How long welshman waits for one request to a signer, rather than how long that request
|
|
64
|
+
* runs — an extension, a native app and a bunker all answer when they answer, and offer
|
|
65
|
+
* no way to recall a request. The caller's `AbortSignal` and `SIGNER_TIMEOUT` each give up
|
|
66
|
+
* on it, so the signer may still answer afterwards with nobody listening.
|
|
67
|
+
*
|
|
68
|
+
* It starts `request` itself, so a request whose signal is already aborted is never sent, and
|
|
69
|
+
* one that throws rather than rejecting still settles.
|
|
70
|
+
*/
|
|
71
|
+
export const signerCall = (request, { signal } = {}) => {
|
|
72
|
+
const result = defer();
|
|
73
|
+
const abort = () => result.reject(new Error("Signer request was aborted"));
|
|
74
|
+
const timer = setTimeout(() => result.reject(new Error("Signer request timed out")), SIGNER_TIMEOUT);
|
|
75
|
+
signal?.addEventListener("abort", abort);
|
|
76
|
+
result.then(noop, noop).then(() => {
|
|
77
|
+
clearTimeout(timer);
|
|
78
|
+
signal?.removeEventListener("abort", abort);
|
|
79
|
+
});
|
|
80
|
+
// A signal that is already aborted never fires "abort"
|
|
81
|
+
if (signal?.aborted) {
|
|
82
|
+
abort();
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
try {
|
|
86
|
+
request().then(result.resolve, result.reject);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
result.reject(error);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
};
|
|
61
94
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../signer/src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../signer/src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAA;AACjD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAC,MAAM,eAAe,CAAA;AAG1D,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,MAAc,EAAE,MAAc,EAAE,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACvF,OAAO,EAAE,CAAC,MAAc,EAAE,MAAc,EAAE,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CACxF,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,eAAe,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE;QACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAW,EAAE,EAAE,CACvC,IAAI,CAAC,EAAE,CAAC,KAAK,CAA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ED,OAAO,MAAoB,CAAA;AAC7B,CAAC,CAAA"}
|
|
@@ -31,6 +31,11 @@ export type EventsByIdForUrlOptions = EventsByIdOptions & {
|
|
|
31
31
|
url: string;
|
|
32
32
|
tracker: Tracker;
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* The events one relay has been seen to hold, narrowed by the filters. The filters choose the
|
|
36
|
+
* index and the tracker answers provenance per event, so the cost tracks what the caller asked
|
|
37
|
+
* for, and a limit counts only events on the relay.
|
|
38
|
+
*/
|
|
34
39
|
export declare const getEventsByIdForUrl: ({ url, filters, tracker, repository, includeDeleted, }: EventsByIdForUrlOptions) => EventsById;
|
|
35
40
|
export declare const deriveEventsByIdForUrl: (options: EventsByIdForUrlOptions) => Projection<EventsById>;
|
|
36
41
|
export type ItemsByKey<T> = Map<string, T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../store/src/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAC,MAAM,cAAc,CAAA;AACxD,OAAO,EAOL,KAAK,EACL,UAAU,EAIX,MAAM,eAAe,CAAA;AACtB,OAAO,EAGL,MAAM,EACN,YAAY,EAIb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAC,UAAU,EAAoB,OAAO,EAAC,MAAM,eAAe,CAAA;AAEnE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AAIzC,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,yCAAuC,iBAAiB,8BAQrF,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,SAAS,iBAAiB,KAA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