Developer Guide

identity/claims/claim

Index

Type aliases

Variables

Functions

Type aliases

Claim

Ƭ Claim: AttestationServiceURLClaim | DomainClaim | KeybaseClaim | NameClaim | AccountClaim

Defined in contractkit/src/identity/claims/claim.ts:48

ClaimPayload

Ƭ ClaimPayload: K extends typeof DOMAIN ? DomainClaim : K extends typeof NAME ? NameClaim : K extends typeof KEYBASE ? KeybaseClaim : K extends typeof ATTESTATION_SERVICE_URL ? AttestationServiceURLClaim : AccountClaim

Defined in contractkit/src/identity/claims/claim.ts:55

DomainClaim

Ƭ DomainClaim: t.TypeOf‹typeof DomainClaimType›

Defined in contractkit/src/identity/claims/claim.ts:46

KeybaseClaim

Ƭ KeybaseClaim: t.TypeOf‹typeof KeybaseClaimType›

Defined in contractkit/src/identity/claims/claim.ts:18

NameClaim

Ƭ NameClaim: t.TypeOf‹typeof NameClaimType›

Defined in contractkit/src/identity/claims/claim.ts:47

Variables

Const ClaimType

ClaimType: UnionC‹[TypeC‹object›, Type‹object, any, unknown›, TypeC‹object›, TypeC‹object›, TypeC‹object›]› = t.union([ AttestationServiceURLClaimType, AccountClaimType, DomainClaimType, KeybaseClaimType, NameClaimType, ])

Defined in contractkit/src/identity/claims/claim.ts:32

Const DOMAIN_TXT_HEADER

DOMAIN_TXT_HEADER: "celo-site-verification" = "celo-site-verification"

Defined in contractkit/src/identity/claims/claim.ts:45

Const KeybaseClaimType

KeybaseClaimType: TypeC‹object› = t.type({ type: t.literal(ClaimTypes.KEYBASE), timestamp: TimestampType, // TODO: Validate compliant username before just interpolating username: t.string, })

Defined in contractkit/src/identity/claims/claim.ts:12

Const SignedClaimType

SignedClaimType: TypeC‹object› = t.type({ claim: ClaimType, signature: SignatureType, })

Defined in contractkit/src/identity/claims/claim.ts:40

Functions

Const createDomainClaim

createDomainClaim(domain: string): DomainClaim

Defined in contractkit/src/identity/claims/claim.ts:104

Parameters:

Name

Type

domain

string

Returns: DomainClaim

Const createNameClaim

createNameClaim(name: string): NameClaim

Defined in contractkit/src/identity/claims/claim.ts:98

Parameters:

Name

Type

name

string

Returns: NameClaim

hashOfClaim

hashOfClaim(claim: Claim): string

Defined in contractkit/src/identity/claims/claim.ts:85

Parameters:

Name

Type

claim

Claim

Returns: string

hashOfClaims

hashOfClaims(claims: Claim[]): string

Defined in contractkit/src/identity/claims/claim.ts:89

Parameters:

Name

Type

claims

Claim[]

Returns: string

Const isOfType

isOfType<K>(type: K): (Anonymous function)

Defined in contractkit/src/identity/claims/claim.ts:65

Type parameters:

K: ClaimTypes

Parameters:

Name

Type

type

K

Returns: (Anonymous function)

serializeClaim

serializeClaim(claim: Claim): string

Defined in contractkit/src/identity/claims/claim.ts:94

Parameters:

Name

Type

claim

Claim

Returns: string

validateClaim

validateClaim(kit: ContractKit, claim: Claim, address: string): Promise‹undefined | string›

Defined in contractkit/src/identity/claims/claim.ts:75

Validates a claim made by an account, i.e. whether the claim is usable

Parameters:

Name

Type

Description

kit

ContractKit

The ContractKit object

claim

Claim

The claim to validate

address

string

The address that is making the claim

Returns: Promise‹undefined | string›

If valid, returns undefined. If invalid or unable to validate, returns a string with the error