Client for requests to and from Lucid
Extended by
Constructors
new DataConnectorClient()
new DataConnectorClient(
cryptoDependencies,
urls,
fetchMethod): DataConnectorClient
Parameters
Parameter | Type | Default value |
---|---|---|
cryptoDependencies | CryptoDependencies | undefined |
urls | object | LUCID_URLS |
urls.api | string | undefined |
urls.main | string | undefined |
fetchMethod | GlobalFetchType | globalFetch |
Returns
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
Parameter | Type |
---|---|
updateToken | string |
Returns
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
Parameter | Type |
---|---|
url | string |
headers | Record <string , unknown > |
actions | unknown |
patchParser | PatchParser <P > |
Returns
Promise
<undefined
| DataConnectorAction
[]>