Skip to main content

RpcClient

Api Code Documentation / Exports / service/RpcClient / RpcClient

service/RpcClient.RpcClient

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RpcClient(settings)

Parameters

NameType
settingsConnectionSettings

Defined in

src/service/RpcClient.ts:78

Properties

instance

Private instance: AxiosInstance

Defined in

src/service/RpcClient.ts:72


timeStamp

Private timeStamp: any

Defined in

src/service/RpcClient.ts:74


tracer

Private tracer: any

Defined in

src/service/RpcClient.ts:76

Methods

convertToReadableItems

Private convertToReadableItems(items): Promise<Type<StreamItem>[]>

Parameters

NameType
itemsStreamItem[]

Returns

Promise<Type<StreamItem>[]>

Defined in

src/service/RpcClient.ts:370


encryptItem

Private encryptItem(item): EncryptedItemToPublish

Parameters

NameType
itemItemToPublish

Returns

EncryptedItemToPublish

Defined in

src/service/RpcClient.ts:319


generateRequest

Private generateRequest(stream, keys, streamitem, address?, offchain?): any

Parameters

NameType
streamString
keysString | String[]
streamitemItemToPublish
address?String
offchain?Boolean

Returns

any

Defined in

src/service/RpcClient.ts:112


getOrDecryptItemData

Private getOrDecryptItemData(item): Type<StreamItem>

Parameters

NameType
itemStreamItem

Returns

Type<StreamItem>

Defined in

src/service/RpcClient.ts:328


handleError

Private handleError(error, method, params): undefined | default

Parameters

NameType
errorany
methodany
paramsany

Returns

undefined | default

Defined in

src/service/RpcClient.ts:272


invoke

invoke(method, ...params): any

Used to invoke MultiChain RPC-Commands. For publishing an event to the chain the invokePublish function should be used

Parameters

NameTypeDescription
methodstringthe RPC-command to be invoked
...paramsany[]the parameters, depend on the specific method, can be stream name, keys, or others

Returns

any

return value also depends on the speicific method, can be listitems, permissions, or others

Defined in

src/service/RpcClient.ts:211


invokePublish

invokePublish(stream, keys, item, address?, offchain?): any

Used to publish a stream item on the chain

Parameters

NameTypeDescription
streamStringname of the stream where the item should be published
keysString | String[]keys of the stremitem
itemanythe item itself
address?Stringthe address to publish the event from. is optional and is only used if the env var SIGNING_METHOD is used
offchain?Booleana boolean indicating whether the item should be saved offchain or not

Returns

any

Defined in

src/service/RpcClient.ts:148


retrieveItems

retrieveItems(streamName, start, count): Promise<Item[]>

Parameters

NameType
streamNamestring
startnumber
countnumber

Returns

Promise<Item[]>

Defined in

src/service/RpcClient.ts:365