diff --git a/build/nostr-lite.js b/build/nostr-lite.js index fd464d0..5e6fe00 100644 --- a/build/nostr-lite.js +++ b/build/nostr-lite.js @@ -8,7 +8,7 @@ * Two-file architecture: * 1. Load nostr.bundle.js (official nostr-tools bundle) * 2. Load nostr-lite.js (this file - NOSTR_LOGIN_LITE library with CSS-only themes) - * Generated on: 2026-07-20T22:03:53.007Z + * Generated on: 2026-07-21T23:30:02.044Z */ // Verify dependencies are loaded @@ -436,7 +436,7 @@ class Modal { modalContent.appendChild(modalHeader); // Add version element in bottom-right corner aligned with modal body const versionElement = document.createElement('div'); - versionElement.textContent = 'v0.1.21'; + versionElement.textContent = 'v0.1.22'; versionElement.style.cssText = ` position: absolute; bottom: 8px; @@ -3516,43 +3516,43 @@ class NSignerWebUSB { async getPublicKey() { const params = [{ nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('get_public_key', params); + const resp = await this._rpcCall('nostr_get_public_key', params); if (!resp || typeof resp.result !== 'string') { - throw new Error('Invalid get_public_key response'); + throw new Error('Invalid nostr_get_public_key response'); } return resp.result.trim().toLowerCase(); } async signEvent(unsignedEvent) { const params = [unsignedEvent, { nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('sign_event', params); + const resp = await this._rpcCall('nostr_sign_event', params); if (!resp || typeof resp.result !== 'object') { - throw new Error('Invalid sign_event response'); + throw new Error('Invalid nostr_sign_event response'); } return resp.result; } async nip04Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_encrypt response'); + const resp = await this._rpcCall('nostr_nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_encrypt response'); return resp.result; } async nip04Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_decrypt response'); + const resp = await this._rpcCall('nostr_nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_decrypt response'); return resp.result; } async nip44Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_encrypt response'); + const resp = await this._rpcCall('nostr_nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_encrypt response'); return resp.result; } async nip44Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_decrypt response'); + const resp = await this._rpcCall('nostr_nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_decrypt response'); return resp.result; } @@ -3914,43 +3914,43 @@ class NSignerWebSerial { async getPublicKey() { const params = [{ nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('get_public_key', params); + const resp = await this._rpcCall('nostr_get_public_key', params); if (!resp || typeof resp.result !== 'string') { - throw new Error('Invalid get_public_key response'); + throw new Error('Invalid nostr_get_public_key response'); } return resp.result.trim().toLowerCase(); } async signEvent(unsignedEvent) { const params = [unsignedEvent, { nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('sign_event', params); + const resp = await this._rpcCall('nostr_sign_event', params); if (!resp || typeof resp.result !== 'object') { - throw new Error('Invalid sign_event response'); + throw new Error('Invalid nostr_sign_event response'); } return resp.result; } async nip04Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_encrypt response'); + const resp = await this._rpcCall('nostr_nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_encrypt response'); return resp.result; } async nip04Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_decrypt response'); + const resp = await this._rpcCall('nostr_nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_decrypt response'); return resp.result; } async nip44Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_encrypt response'); + const resp = await this._rpcCall('nostr_nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_encrypt response'); return resp.result; } async nip44Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_decrypt response'); + const resp = await this._rpcCall('nostr_nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_decrypt response'); return resp.result; } diff --git a/src/VERSION b/src/VERSION index 7906299..7e72641 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -0.1.21 +0.1.22 diff --git a/src/signers/nsigner-webserial.js b/src/signers/nsigner-webserial.js index 8579ceb..3c92531 100644 --- a/src/signers/nsigner-webserial.js +++ b/src/signers/nsigner-webserial.js @@ -188,43 +188,43 @@ class NSignerWebSerial { async getPublicKey() { const params = [{ nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('get_public_key', params); + const resp = await this._rpcCall('nostr_get_public_key', params); if (!resp || typeof resp.result !== 'string') { - throw new Error('Invalid get_public_key response'); + throw new Error('Invalid nostr_get_public_key response'); } return resp.result.trim().toLowerCase(); } async signEvent(unsignedEvent) { const params = [unsignedEvent, { nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('sign_event', params); + const resp = await this._rpcCall('nostr_sign_event', params); if (!resp || typeof resp.result !== 'object') { - throw new Error('Invalid sign_event response'); + throw new Error('Invalid nostr_sign_event response'); } return resp.result; } async nip04Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_encrypt response'); + const resp = await this._rpcCall('nostr_nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_encrypt response'); return resp.result; } async nip04Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_decrypt response'); + const resp = await this._rpcCall('nostr_nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_decrypt response'); return resp.result; } async nip44Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_encrypt response'); + const resp = await this._rpcCall('nostr_nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_encrypt response'); return resp.result; } async nip44Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_decrypt response'); + const resp = await this._rpcCall('nostr_nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_decrypt response'); return resp.result; } diff --git a/src/signers/nsigner-webusb.js b/src/signers/nsigner-webusb.js index 95bebf9..c5ceb58 100644 --- a/src/signers/nsigner-webusb.js +++ b/src/signers/nsigner-webusb.js @@ -154,43 +154,43 @@ class NSignerWebUSB { async getPublicKey() { const params = [{ nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('get_public_key', params); + const resp = await this._rpcCall('nostr_get_public_key', params); if (!resp || typeof resp.result !== 'string') { - throw new Error('Invalid get_public_key response'); + throw new Error('Invalid nostr_get_public_key response'); } return resp.result.trim().toLowerCase(); } async signEvent(unsignedEvent) { const params = [unsignedEvent, { nostr_index: this.nostrIndex }]; - const resp = await this._rpcCall('sign_event', params); + const resp = await this._rpcCall('nostr_sign_event', params); if (!resp || typeof resp.result !== 'object') { - throw new Error('Invalid sign_event response'); + throw new Error('Invalid nostr_sign_event response'); } return resp.result; } async nip04Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_encrypt response'); + const resp = await this._rpcCall('nostr_nip04_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_encrypt response'); return resp.result; } async nip04Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip04_decrypt response'); + const resp = await this._rpcCall('nostr_nip04_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip04_decrypt response'); return resp.result; } async nip44Encrypt(peerHex, plaintext) { - const resp = await this._rpcCall('nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_encrypt response'); + const resp = await this._rpcCall('nostr_nip44_encrypt', [peerHex, plaintext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_encrypt response'); return resp.result; } async nip44Decrypt(peerHex, ciphertext) { - const resp = await this._rpcCall('nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); - if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nip44_decrypt response'); + const resp = await this._rpcCall('nostr_nip44_decrypt', [peerHex, ciphertext, { nostr_index: this.nostrIndex }]); + if (!resp || typeof resp.result !== 'string') throw new Error('Invalid nostr_nip44_decrypt response'); return resp.result; }