mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 13:22:54 +00:00
Merge pull request #1976 from PR0M3TH3AN/codex/update-signer-hydration-for-nip-07
Support NIP‑07 hydration and refresh NIP‑44 capabilities on active signer
This commit is contained in:
1 file changed
+14
-1
+14
-1
@@ -323,7 +323,12 @@ function resolveSignerCapabilities(signer) {
|
||||
}
|
||||
|
||||
function hydrateExtensionSignerCapabilities(signer) {
|
||||
if (!signer || typeof signer !== "object" || signer.type !== "extension") {
|
||||
if (!signer || typeof signer !== "object") {
|
||||
return;
|
||||
}
|
||||
|
||||
const signerType = typeof signer.type === "string" ? signer.type : "";
|
||||
if (signerType !== "extension" && signerType !== "nip07") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -371,6 +376,10 @@ function setActiveSigner(signer) {
|
||||
function getActiveSigner() {
|
||||
const signer = getActiveSignerFromRegistry();
|
||||
hydrateExtensionSignerCapabilities(signer);
|
||||
attachNipMethodAliases(signer);
|
||||
if (signer && typeof signer === "object") {
|
||||
signer.capabilities = resolveSignerCapabilities(signer);
|
||||
}
|
||||
return signer;
|
||||
}
|
||||
|
||||
@@ -385,6 +394,10 @@ function logoutSigner(pubkey) {
|
||||
function resolveActiveSigner(pubkey) {
|
||||
const signer = resolveActiveSignerFromRegistry(pubkey);
|
||||
hydrateExtensionSignerCapabilities(signer);
|
||||
attachNipMethodAliases(signer);
|
||||
if (signer && typeof signer === "object") {
|
||||
signer.capabilities = resolveSignerCapabilities(signer);
|
||||
}
|
||||
return signer;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user