DataConnectorClient

Client for requests to and from Lucid

Extended by


Constructors

new DataConnectorClient()

new DataConnectorClient(
   cryptoDependencies, 
   urls, 
   fetchMethod): DataConnectorClient

Parameters

ParameterTypeDefault value
cryptoDependenciesCryptoDependenciesundefined
urlsobjectLUCID_URLS
urls.apistringundefined
urls.mainstringundefined
fetchMethodGlobalFetchTypeglobalFetch

Returns

DataConnectorClient


Properties

urls

urls: object = LUCID_URLS;

api

api: string;

main

main: string;

Methods

getDataSourceClient()

getDataSourceClient(updateToken): DataSourceClient

Get a client for DataSource related requests to Lucid

Parameters

ParameterType
updateTokenstring

Returns

DataSourceClient


getPublicKey()

getPublicKey(): Promise<string>

Get Lucid's public key to verify requests came from Lucid if you don't want to use the SignatureValidator. Maybe
you're not running in a NodeJS environment

Returns

Promise<string>


getSignatureValidator()

getSignatureValidator(): Promise<SignatureValidator>

Get a validator to prove a given request came from Lucid

Returns

Promise<SignatureValidator>


parseActions()

parseActions<P>(
   url, 
   headers, 
   actions, 
patchParser): Promise<undefined | DataConnectorAction[]>

Validate and parse an action request from Lucid

Type parameters

Type parameter
P extends Patch

Parameters

ParameterType
urlstring
headersRecord<string, unknown>
actionsunknown
patchParserPatchParser<P>

Returns

Promise<undefined | DataConnectorAction[]>