Developer Guide

identity/claims/account

Index

Type aliases

Variables

Functions

Type aliases

AccountClaim

Ƭ AccountClaim: t.TypeOf‹typeof AccountClaimTypeH›

Defined in contractkit/src/identity/claims/account.ts:34

Variables

Const AccountClaimType

AccountClaimType: Type‹object, any, unknown› = new t.Type( 'AccountClaimType', AccountClaimTypeH.is, (unknownValue, context) => either.chain(AccountClaimTypeH.validate(unknownValue, context), (claim) => { if (claim.publicKey === undefined) { return t.success(claim) } const derivedAddress = toChecksumAddress( '0x' + pubToAddress(Buffer.from(claim.publicKey.slice(2), 'hex'), true).toString('hex') ) return derivedAddress === claim.address ? t.success(claim) : t.failure(claim, context, 'public key did not match the address in the claim') }), (x) => x )

Defined in contractkit/src/identity/claims/account.ts:16

Const AccountClaimTypeH

AccountClaimTypeH: TypeC‹object› = t.type({ type: t.literal(ClaimTypes.ACCOUNT), timestamp: TimestampType, address: AddressType, // io-ts way of defining optional key-value pair publicKey: t.union([t.undefined, PublicKeyType]), })

Defined in contractkit/src/identity/claims/account.ts:8

Functions

Const createAccountClaim

createAccountClaim(address: string, publicKey?: undefined | string): AccountClaim

Defined in contractkit/src/identity/claims/account.ts:36

Parameters:

Name

Type

address

string

publicKey?

undefined | string

Returns: AccountClaim