@konemono/nostr-login 1.10.4 → 1.10.5
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/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/unpkg.js +2 -2
- package/package.json +1 -1
- package/src/modules/AuthNostrService.ts +3 -6
package/package.json
CHANGED
|
@@ -9,9 +9,9 @@ import { Signer } from './Nostr';
|
|
|
9
9
|
import { Nip44 } from '../utils/nip44';
|
|
10
10
|
import { IframeNostrRpc, Nip46Signer, ReadyListener } from './Nip46';
|
|
11
11
|
import { PrivateKeySigner } from './Signer';
|
|
12
|
+
import { DEFAULT_NIP46_RELAYS } from '../const';
|
|
12
13
|
|
|
13
14
|
const OUTBOX_RELAYS = ['wss://user.kindpag.es', 'wss://purplepag.es', 'wss://relay.nos.social'];
|
|
14
|
-
const DEFAULT_NOSTRCONNECT_RELAY = 'wss://relay.nsec.app/';
|
|
15
15
|
const NOSTRCONNECT_APPS: ConnectionString[] = [
|
|
16
16
|
{
|
|
17
17
|
name: 'Nsec.app',
|
|
@@ -19,19 +19,16 @@ const NOSTRCONNECT_APPS: ConnectionString[] = [
|
|
|
19
19
|
canImport: true,
|
|
20
20
|
img: 'https://nsec.app/assets/favicon.ico',
|
|
21
21
|
link: 'https://use.nsec.app/<nostrconnect>',
|
|
22
|
-
relay: 'wss://relay.nsec.app/',
|
|
23
22
|
},
|
|
24
23
|
{
|
|
25
24
|
name: 'Amber',
|
|
26
25
|
img: 'https://raw.githubusercontent.com/greenart7c3/Amber/refs/heads/master/assets/android-icon.svg',
|
|
27
26
|
link: '<nostrconnect>',
|
|
28
|
-
relay: 'wss://relay.nsec.app/',
|
|
29
27
|
},
|
|
30
28
|
{
|
|
31
29
|
name: 'Other key stores',
|
|
32
30
|
img: '',
|
|
33
31
|
link: '<nostrconnect>',
|
|
34
|
-
relay: 'wss://relay.nsec.app/',
|
|
35
32
|
},
|
|
36
33
|
];
|
|
37
34
|
|
|
@@ -138,7 +135,7 @@ class AuthNostrService extends EventEmitter implements Signer {
|
|
|
138
135
|
} = {},
|
|
139
136
|
) {
|
|
140
137
|
// カスタムリレーが指定されていれば使用、そうでなければ単一リレーまたはデフォルト
|
|
141
|
-
const relays = customRelays && customRelays.length > 0 ? customRelays : [relay
|
|
138
|
+
const relays = customRelays && customRelays.length > 0 ? customRelays : relay ? [relay] : DEFAULT_NIP46_RELAYS;
|
|
142
139
|
|
|
143
140
|
const info: Info = {
|
|
144
141
|
authMethod: 'connect',
|
|
@@ -204,7 +201,7 @@ class AuthNostrService extends EventEmitter implements Signer {
|
|
|
204
201
|
// }
|
|
205
202
|
|
|
206
203
|
for (const a of apps) {
|
|
207
|
-
let relays = customRelays && customRelays.length > 0 ? customRelays :
|
|
204
|
+
let relays = customRelays && customRelays.length > 0 ? customRelays : DEFAULT_NIP46_RELAYS;
|
|
208
205
|
if (a.link.startsWith('https://')) {
|
|
209
206
|
let domain = a.domain || new URL(a.link).hostname;
|
|
210
207
|
try {
|