How to use the @celo/contractkit/lib/identity.createNameClaim 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 / celotool / src / cmds / deploy / initial / contracts.ts View on Github external
async function makeMetadata(testnet: string, address: string, index: number) {
  const attestationServiceClaim = createAttestationServiceURLClaim(
    getAttestationServiceUrl(testnet, index)
  )

  const nameClaim = createNameClaim(`Validator ${index} on ${testnet}: ${address}`)

  const fileName = `validator-${testnet}-${address}-metadata.json`
  const filePath = `/tmp/${fileName}`

  const metadata = IdentityMetadataWrapper.fromEmpty()
  metadata.addClaim(nameClaim)
  metadata.addClaim(attestationServiceClaim)
  writeFileSync(filePath, metadata.toString())

  await uploadFileToGoogleStorage(
    filePath,
    CLABS_VALIDATOR_METADATA_BUCKET,
    `${testnet}/${fileName}`,
    false,
    'application/json'
  )
github celo-org / celo-monorepo / packages / cli / src / commands / account / change-name.ts View on Github external
modifyMetadata(res.args.file, (metadata) => {
      const claim = createNameClaim(res.flags.name)
      metadata.addClaim(claim)
    })
  }