Skip to content

Class: RequestClient<ModelTypes, Alias>

react.RequestClient

Extends core.Core

import { RequestClient } from '@self.id/react'

Type parameters

Name Type
ModelTypes extends ModelTypeAliases = CoreModelTypes
Alias extends keyof ModelTypes["definitions"] = keyof ModelTypes["definitions"]

Hierarchy

  • Core<ModelTypes>

RequestClient

Constructors

constructor

new RequestClient<ModelTypes, Alias>(params)

Type parameters

Name Type
ModelTypes extends ModelTypeAliases<Record<string, any>, Record<string, string>, Record<string, string>> = ModelTypes
Alias extends string | number | symbol = keyof ModelTypes["definitions"]

Parameters

Name Type
params RequestClientParams<ModelTypes>

Overrides

Core<ModelTypes\>.constructor

Accessors

ceramic

get ceramic(): CeramicClient

Returns

CeramicClient

Inherited from

Core.ceramic


dataModel

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

Returns

DataModel<ModelTypes, ModelTypesToAliases<ModelTypes>>

Inherited from

Core.dataModel


dataStore

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

Returns

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

Inherited from

Core.dataStore


resolver

get resolver(): Resolver

Returns

Resolver

Inherited from

Core.resolver


tileLoader

get tileLoader(): TileLoader

Returns

TileLoader

Inherited from

Core.tileLoader


viewerID

get viewerID(): null | string

Returns

null | string

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>

Inherited from

Core.get


getAccountDID

getAccountDID(account): Promise<string>

Parameters

Name Type
account string

Returns

Promise<string>

Inherited from

Core.getAccountDID


getState

getState(): RequestState

Returns

RequestState


prefetch

prefetch<Key>(key, id?): Promise<boolean>

Type parameters

Name Type
Key extends string | number | symbol

Parameters

Name Type
key Key
id null | string

Returns

Promise<boolean>


toDID

toDID(accountOrDID): Promise<string>

Parameters

Name Type
accountOrDID string

Returns

Promise<string>

Inherited from

Core.toDID