|
|
|
|
@ -12,7 +12,7 @@ export class BunkerSigner implements ISigner {
@@ -12,7 +12,7 @@ export class BunkerSigner implements ISigner {
|
|
|
|
|
this.clientSecretKey = clientSecretKey ? hexToBytes(clientSecretKey) : generateSecretKey() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async login(bunker: string): Promise<string> { |
|
|
|
|
async login(bunker: string, isInitialConnection = true): Promise<string> { |
|
|
|
|
const bunkerPointer = await parseBunkerInput(bunker) |
|
|
|
|
if (!bunkerPointer) { |
|
|
|
|
throw new Error('Invalid bunker') |
|
|
|
|
@ -23,7 +23,9 @@ export class BunkerSigner implements ISigner {
@@ -23,7 +23,9 @@ export class BunkerSigner implements ISigner {
|
|
|
|
|
window.open(url, '_blank') |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if (isInitialConnection) { |
|
|
|
|
await this.signer.connect() |
|
|
|
|
} |
|
|
|
|
return await this.signer.getPublicKey() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|