Skip to content

Class: Core<ModelTypes, Alias>

core.Core

import { Core } from '@self.id/core'

Type parameters

Name Type
ModelTypes extends CoreModelTypesCoreModelTypes
Alias extends keyof ModelTypes["definitions"]keyof ModelTypes["definitions"]

Constructors

constructor

new Core<ModelTypes, Alias>(params)

Type parameters

Name Type
ModelTypes extends CoreModelTypesCoreModelTypes
Alias extends string | number | symbolkeyof ModelTypes["definitions"]

Parameters

Name Type
params CoreParams<ModelTypes>

Accessors

ceramic

get ceramic(): CeramicClient

Returns

CeramicClient


dataModel

get dataModel(): DataModel<ModelTypes, ModelTypesToAliases<ModelTypes>>

Returns

DataModel<ModelTypes, ModelTypesToAliases<ModelTypes>>


dataStore

get dataStore(): DIDDataStore<ModelTypes, keyof ModelTypes["definitions"]>

Returns

DIDDataStore<ModelTypes, keyof ModelTypes["definitions"]>


resolver

get resolver(): Resolver

Returns

Resolver

Methods

get

get<Key, ContentType>(key, id): Promise<null | ContentType>

Type parameters

Name Type
Key extends string | number | symbol
ContentType DefinitionContentType<ModelTypes, Key>

Parameters

Name Type
key Key
id string

Returns

Promise<null | ContentType>


getAccountDID

getAccountDID(account): Promise<string>

Parameters

Name Type
account string

Returns

Promise<string>


toDID

toDID(accountOrDID): Promise<string>

Parameters

Name Type
accountOrDID string

Returns

Promise<string>