You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
820 B
31 lines
820 B
/** |
|
* NIP-46 Bunker signer (remote signer) |
|
*/ |
|
/** |
|
* Connect to bunker signer |
|
*/ |
|
export async function connectBunker(bunkerUri) { |
|
// Parse bunker:// URI |
|
// Format: bunker://<pubkey>@<relay>?token=<token> |
|
const match = bunkerUri.match(/^bunker:\/\/([^@]+)@([^?]+)(?:\?token=([^&]+))?$/); |
|
if (!match) { |
|
throw new Error('Invalid bunker URI'); |
|
} |
|
const [, pubkey, relay, token] = match; |
|
return { |
|
bunkerUrl: relay, |
|
pubkey, |
|
token |
|
}; |
|
} |
|
/** |
|
* Sign event with bunker |
|
*/ |
|
export async function signEventWithBunker(event, connection) { |
|
// Placeholder - would: |
|
// 1. Send NIP-46 request to bunker |
|
// 2. Wait for response |
|
// 3. Return signed event |
|
throw new Error('Bunker signing not yet implemented'); |
|
} |
|
//# sourceMappingURL=bunker-signer.js.map
|