Use random private key for bunker connection

This commit is contained in:
2023-07-12 11:32:44 +01:00
parent 1cb27c1881
commit 63428142e5
4 changed files with 18 additions and 11 deletions

View File

@ -43,6 +43,10 @@ export class PrivateKeySigner implements EventSigner {
this.#publicKey = getPublicKey(this.#privateKey);
}
get privateKey() {
return this.#privateKey;
}
init(): Promise<void> {
return Promise.resolve();
}

View File

@ -67,6 +67,12 @@ export class Nip46Signer implements EventSigner {
return [this.#relay];
}
get privateKey() {
if(this.#insideSigner instanceof PrivateKeySigner) {
return this.#insideSigner.privateKey;
}
}
async init() {
const isBunker = this.#proto === "bunker:";
if (isBunker) {