Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const publicFolderPrefix = `/keybase/public/${username}/`
await this.ensureKeybaseFilePathToProof(publicFolderPrefix)
const fileName = proofFileName(address)
const tmpPath = `${tmpdir()}/${fileName}`
writeFileSync(tmpPath, JSON.stringify(signedClaim))
await execCmdWithError(
'keybase',
['fs', 'cp', tmpPath, publicFolderPrefix + keybaseFilePathToProof + '/' + fileName],
{ silent: true }
)
cli.action.stop()
cli.action.start(`Claim successfully copied to the keybase file system, verifying proof`)
// Wait for changes to propagate
await sleep(3000)
const verificationError = await verifyKeybaseClaim(claim, address)
if (verificationError) {
throw new Error(`Claim is not verifiable: ${verificationError}`)
}
cli.action.stop()
console.info('Claim is verifiable!')
} catch (error) {
cli.action.stop(`Error: ${error}`)
throw error
}
}
async uploadProof(claim: KeybaseClaim, signature: string, username: string, address: string) {