Still don't have dm working because I can't decrypt at primal.
This commit is contained in:
@@ -165,8 +165,8 @@ class Modal {
|
||||
});
|
||||
}
|
||||
|
||||
// Nostr Connect option
|
||||
if (this.options?.methods?.connect !== false) {
|
||||
// Nostr Connect option (check both 'connect' and 'remote' for compatibility)
|
||||
if (this.options?.methods?.connect !== false && this.options?.methods?.remote !== false) {
|
||||
options.push({
|
||||
type: 'connect',
|
||||
title: 'Nostr Connect',
|
||||
@@ -186,7 +186,7 @@ class Modal {
|
||||
}
|
||||
|
||||
// OTP/DM option
|
||||
if (this.options?.methods?.otp !== false && this.options?.otp) {
|
||||
if (this.options?.methods?.otp !== false) {
|
||||
options.push({
|
||||
type: 'otp',
|
||||
title: 'DM/OTP',
|
||||
@@ -858,11 +858,7 @@ class Modal {
|
||||
box-sizing: border-box;
|
||||
`;
|
||||
|
||||
// Pre-fill with our bunker config if available
|
||||
if (window.NIP46_BUNKER_CONFIG) {
|
||||
pubkeyInput.value = window.NIP46_BUNKER_CONFIG.remoteSigner.pubkey;
|
||||
urlInput.value = window.NIP46_BUNKER_CONFIG.remoteSigner.url;
|
||||
}
|
||||
// Users will enter the bunker URL manually from their bunker setup
|
||||
|
||||
const connectButton = document.createElement('button');
|
||||
connectButton.textContent = 'Connect to Bunker';
|
||||
@@ -956,9 +952,9 @@ class Modal {
|
||||
const localSecretKey = window.NostrTools.generateSecretKey();
|
||||
console.log('Generated local client keypair for NIP-46 session');
|
||||
|
||||
// Use nostr-tools BunkerSigner.fromBunker() for bunker:// connections
|
||||
// Use nostr-tools BunkerSigner constructor
|
||||
console.log('Creating nip46 BunkerSigner...');
|
||||
const signer = window.NostrTools.nip46.BunkerSigner.fromBunker(localSecretKey, bunkerPointer, {
|
||||
const signer = new window.NostrTools.nip46.BunkerSigner(localSecretKey, bunkerPointer, {
|
||||
onauth: (url) => {
|
||||
console.log('Received auth URL from bunker:', url);
|
||||
// Open auth URL in popup or redirect
|
||||
@@ -968,12 +964,8 @@ class Modal {
|
||||
|
||||
console.log('NIP-46 BunkerSigner created successfully');
|
||||
|
||||
// Attempt initial ping to verify connection
|
||||
console.log('Testing bunker connection with ping...');
|
||||
await signer.ping();
|
||||
console.log('NIP-46 ping successful - bunker is reachable');
|
||||
|
||||
// Try to connect (this may trigger auth flow)
|
||||
// Skip ping test - NIP-46 works through relays, not direct connection
|
||||
// Try to connect directly (this may trigger auth flow)
|
||||
console.log('Attempting NIP-46 connect...');
|
||||
await signer.connect();
|
||||
console.log('NIP-46 connect successful');
|
||||
|
||||
Reference in New Issue
Block a user