@konemono/nostr-login 1.9.7 → 1.9.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konemono/nostr-login",
3
- "version": "1.9.7",
3
+ "version": "1.9.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -129,9 +129,10 @@ class AuthNostrService extends EventEmitter implements Signer {
129
129
  // non-iframe flow - Amber も NIP-46 経由(nostrsigner:// の代わりに nostrconnect:// を使用)
130
130
  if (link && !iframeUrl) {
131
131
  if (link === 'amber') {
132
- // Amber を通常の nostrconnect フローとして扱う
133
- // popup は開かない - Amber は自動で nostrconnect:// を処理する
134
- console.log('Amber flow via NIP-46 (nostrconnect)');
132
+ // Amber nostrconnect:// URL を渡す
133
+ const nostrconnectUrl = await this.createNostrConnect(relays);
134
+ console.log('Amber flow via NIP-46, opening:', nostrconnectUrl);
135
+ window.location.href = nostrconnectUrl;
135
136
  } else {
136
137
  window.open(link, '_blank', 'width=400,height=700');
137
138
  }
@@ -170,7 +171,7 @@ class AuthNostrService extends EventEmitter implements Signer {
170
171
  perms: encodeURIComponent(this.params.optionsModal.perms || ''),
171
172
  };
172
173
 
173
- return `nostrconnect://${pubkey}?image=${meta.icon}&url=${meta.url}&name=${meta.name}&perms=${meta.perms}&secret=${this.nostrConnectSecret}${(relays || []).length > 0 ? (relays || []).map((r, i) => `&relay=${r}`) : ''}`;
174
+ return `nostrconnect://${pubkey}?image=${meta.icon}&url=${meta.url}&name=${meta.name}&perms=${meta.perms}&secret=${this.nostrConnectSecret}${(relays || []).length > 0 ? (relays || []).map((r, i) => `&relay=${r}`).join('') : ''}`;
174
175
  }
175
176
 
176
177
  public async getNostrConnectServices(): Promise<[string, ConnectionString[]]> {