How to use the @celo/contractkit/lib/identity/claims/keybase.verifyKeybaseClaim function in @celo/contractkit

To help you get started, we’ve selected a few @celo/contractkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celo-org / celo-monorepo / packages / cli / src / commands / account / claim-keybase.ts View on Github external
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) {