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:71

Properties#

instance#

Private instance: AxiosInstance

Defined in#

src/service/RpcClient.ts:67


timeStamp#

Private timeStamp: any

Defined in#

src/service/RpcClient.ts:69

Methods#

convertToReadableItems#

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

Parameters#

NameType
itemsStreamItem[]

Returns#

Promise<Type<StreamItem>[]>

Defined in#

src/service/RpcClient.ts:341


encryptItem#

Private encryptItem(item): EncryptedItemToPublish

Parameters#

NameType
itemItemToPublish

Returns#

EncryptedItemToPublish

Defined in#

src/service/RpcClient.ts:290


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:104


getOrDecryptItemData#

Private getOrDecryptItemData(item): Type<StreamItem>

Parameters#

NameType
itemStreamItem

Returns#

Type<StreamItem>

Defined in#

src/service/RpcClient.ts:299


handleError#

Private handleError(error, method, params): any

Parameters#

NameType
errorany
methodany
paramsany

Returns#

any

Defined in#

src/service/RpcClient.ts:250


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:194


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:140


retrieveItems#

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

Parameters#

NameType
streamNamestring
startnumber
countnumber

Returns#

Promise<Item[]>

Defined in#

src/service/RpcClient.ts:336