Class: HttpDataAccess
"http-data-access".HttpDataAccess
Exposes a Data-Access module over HTTP
Hierarchy
HttpDataAccess
Implements
- IDataAccess
Constructors
constructor
+ new HttpDataAccess(nodeConnectionConfig
: AxiosRequestConfig): HttpDataAccess
Defined in request-client.js/src/http-data-access.ts:31
Creates an instance of HttpDataAccess.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
nodeConnectionConfig | AxiosRequestConfig | {} | Configuration options to connect to the node. Follows Axios configuration format. |
Returns: HttpDataAccess
Properties
axiosConfig
• Protected
axiosConfig: AxiosRequestConfig
Defined in request-client.js/src/http-data-access.ts:31
Configuration that will be sent to axios for each request. We can also create a AxiosInstance with axios.create() but it dramatically complicates testing.
Methods
_getStatus
▸ _getStatus(detailed?
: boolean): Promise<any>
Defined in request-client.js/src/http-data-access.ts:213
Gets information from the node (version, files etc...)
Parameters:
Name | Type | Description |
---|---|---|
detailed? | boolean | if true get the list of files hashes |
Returns: Promise<any>
getChannelsByMultipleTopics
▸ getChannelsByMultipleTopics(topics
: string[], updatedBetween?
: ITimestampBoundaries): Promise<IReturnGetChannelsByTopic>
Defined in request-client.js/src/http-data-access.ts:187
Gets all the transactions of channel indexed by multiple topics from the node through HTTP.
Parameters:
Name | Type | Description |
---|---|---|
topics | string[] | topics to search for |
updatedBetween? | ITimestampBoundaries | filter timestamp boundaries |
Returns: Promise<IReturnGetChannelsByTopic>
getChannelsByTopic
▸ getChannelsByTopic(topic
: string, updatedBetween?
: ITimestampBoundaries): Promise<IReturnGetChannelsByTopic>
Defined in request-client.js/src/http-data-access.ts:160
Gets all the transactions of channel indexed by topic from the node through HTTP.
Parameters:
Name | Type | Description |
---|---|---|
topic | string | topic to search for |
updatedBetween? | ITimestampBoundaries | filter timestamp boundaries |
Returns: Promise<IReturnGetChannelsByTopic>
getTransactionsByChannelId
▸ getTransactionsByChannelId(channelId
: string, timestampBoundaries?
: ITimestampBoundaries): Promise<IReturnGetTransactions>
Defined in request-client.js/src/http-data-access.ts:133
Gets the transactions for a channel from the node through HTTP.
Parameters:
Name | Type | Description |
---|---|---|
channelId | string | The channel id to search for |
timestampBoundaries? | ITimestampBoundaries | filter timestamp boundaries |
Returns: Promise<IReturnGetTransactions>
initialize
▸ initialize(): Promise<void>
Defined in request-client.js/src/http-data-access.ts:57
Initialize the module. Does nothing, exists only to implement IDataAccess
Returns: Promise<void>
nothing
persistTransaction
▸ persistTransaction(transactionData
: ITransaction, channelId
: string, topics?
: string[]): Promise<IReturnPersistTransaction>
Defined in request-client.js/src/http-data-access.ts:68
Persists a new transaction on a node through HTTP.
Parameters:
Name | Type | Description |
---|---|---|
transactionData | ITransaction | The transaction data |
channelId | string | - |
topics? | string[] | The topics used to index the transaction |
Returns: Promise<IReturnPersistTransaction>