RpcClient
Api Code Documentation / Exports / service/RpcClient / RpcClient
service/RpcClient.RpcClient
#
Table of contents#
Constructors#
Properties#
Methods- convertToReadableItems
- encryptItem
- generateRequest
- getOrDecryptItemData
- handleError
- invoke
- invokePublish
- retrieveItems
#
Constructors#
constructor• new RpcClient(settings
)
#
ParametersName | Type |
---|---|
settings | ConnectionSettings |
#
Defined in#
Properties#
instance• Private
instance: AxiosInstance
#
Defined in#
timeStamp• Private
timeStamp: any
#
Defined in#
Methods#
convertToReadableItemsâ–¸ Private
convertToReadableItems(items
): Promise
<Type
<StreamItem
>[]>
#
ParametersName | Type |
---|---|
items | StreamItem [] |
#
ReturnsPromise
<Type
<StreamItem
>[]>
#
Defined in#
encryptItemâ–¸ Private
encryptItem(item
): EncryptedItemToPublish
#
ParametersName | Type |
---|---|
item | ItemToPublish |
#
Returns#
Defined in#
generateRequestâ–¸ Private
generateRequest(stream
, keys
, streamitem
, address?
, offchain?
): any
#
ParametersName | Type |
---|---|
stream | String |
keys | String | String [] |
streamitem | ItemToPublish |
address? | String |
offchain? | Boolean |
#
Returnsany
#
Defined in#
getOrDecryptItemDataâ–¸ Private
getOrDecryptItemData(item
): Type
<StreamItem
>
#
ParametersName | Type |
---|---|
item | StreamItem |
#
Returns#
Defined in#
handleErrorâ–¸ Private
handleError(error
, method
, params
): any
#
ParametersName | Type |
---|---|
error | any |
method | any |
params | any |
#
Returnsany
#
Defined in#
invokeâ–¸ invoke(method
, ...params
): any
Used to invoke MultiChain RPC-Commands. For publishing an event to the chain the invokePublish function should be used
#
ParametersName | Type | Description |
---|---|---|
method | string | the RPC-command to be invoked |
...params | any [] | the parameters, depend on the specific method, can be stream name, keys, or others |
#
Returnsany
return value also depends on the speicific method, can be listitems, permissions, or others
#
Defined in#
invokePublishâ–¸ invokePublish(stream
, keys
, item
, address?
, offchain?
): any
Used to publish a stream item on the chain
#
ParametersName | Type | Description |
---|---|---|
stream | String | name of the stream where the item should be published |
keys | String | String [] | keys of the stremitem |
item | any | the item itself |
address? | String | the address to publish the event from. is optional and is only used if the env var SIGNING_METHOD is used |
offchain? | Boolean | a boolean indicating whether the item should be saved offchain or not |
#
Returnsany
#
Defined in#
retrieveItemsâ–¸ retrieveItems(streamName
, start
, count
): Promise
<Item
[]>
#
ParametersName | Type |
---|---|
streamName | string |
start | number |
count | number |
#
ReturnsPromise
<Item
[]>