Skip to main content

RpcMultichainClient

Api Code Documentation / Exports / service/Client / RpcMultichainClient

service/Client.RpcMultichainClient

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new RpcMultichainClient(settings)

Parameters

NameType
settingsConnectionSettings

Defined in

src/service/Client.ts:47

Properties

hasWriteLock

Private hasWriteLock: boolean

Defined in

src/service/Client.ts:45


rpcClient

Private rpcClient: RpcClient

Defined in

src/service/Client.ts:43

Methods

getInfo

getInfo(): Promise<any>

Returns

Promise<any>

Implementation of

MultichainClient.getInfo

Defined in

src/service/Client.ts:138


getLastBlockInfo

getLastBlockInfo(skip?): Promise<BlockInfo>

Get the latest block, possibly skipping a few.

Parameters

NameTypeDefault valueDescription
skipnumber0number of blocks to skip, default 0 (= latest block)

Returns

Promise<BlockInfo>

Implementation of

MultichainClient.getLastBlockInfo

Defined in

src/service/Client.ts:247


getLatestValues

getLatestValues(streamName, key, nValues?): Promise<StreamItemPair[]>

Parameters

NameTypeDefault value
streamNamestringundefined
keystringundefined
nValuesnumbermaxItemCount

Returns

Promise<StreamItemPair[]>

Implementation of

MultichainClient.getLatestValues

Defined in

src/service/Client.ts:162


getOrCreateStream

getOrCreateStream(options): Promise<string>

Parameters

NameType
optionsCreateStreamOptions

Returns

Promise<string>

Implementation of

MultichainClient.getOrCreateStream

Defined in

src/service/Client.ts:56


getPeerInfo

getPeerInfo(): Promise<PeerInfo[]>

Returns

Promise<PeerInfo[]>

Implementation of

MultichainClient.getPeerInfo

Defined in

src/service/Client.ts:251


getRpcClient

getRpcClient(): RpcClient

Returns

RpcClient

Implementation of

MultichainClient.getRpcClient

Defined in

src/service/Client.ts:52


getValue

getValue(streamName, key): Promise<StreamItemPair>

Parameters

NameType
streamNamestring
keystring

Returns

Promise<StreamItemPair>

Implementation of

MultichainClient.getValue

Defined in

src/service/Client.ts:209


getValues

getValues(streamName, key, nValues?): Promise<StreamItemPair[]>

Parameters

NameTypeDefault value
streamNamestringundefined
keystringundefined
nValuesnumbermaxItemCount

Returns

Promise<StreamItemPair[]>

Implementation of

MultichainClient.getValues

Defined in

src/service/Client.ts:142


isValidAddress

isValidAddress(address): Promise<boolean>

Parameters

NameType
addressstring

Returns

Promise<boolean>

Implementation of

MultichainClient.isValidAddress

Defined in

src/service/Client.ts:133


latestValuesForKey

latestValuesForKey(streamId, key, nValues?): Promise<any[]>

Parameters

NameTypeDefault value
streamIdstringundefined
keystringundefined
nValuesnumber1

Returns

Promise<any[]>

Implementation of

MultichainClient.latestValuesForKey

Defined in

src/service/Client.ts:109


listBlocksByHeight

listBlocksByHeight(to, from?, verbose?): Promise<BlockListItem[]>

Retrieve all blocks metadata by block height range. You can retrieve the current maximum block height through calling getLastBlockInfo

Parameters

NameTypeDefault valueDescription
tonumberundefinedhighest block height to return (inclusive)
fromstring | number0lowest block to return (inclusive), defaults to 0
verbosebooleanfalseverbose output, defaults to false

Returns

Promise<BlockListItem[]>

Implementation of

MultichainClient.listBlocksByHeight

Defined in

src/service/Client.ts:259


listStreamBlockItemsByHeight

listStreamBlockItemsByHeight(streamName, to, from?, verbose?): Promise<Item[]>

Retrieve all items within a stream by block height range.

Parameters

NameTypeDefault valueDescription
streamNamestringundefinedStream Name to Read
tonumberundefinedHighest block height to retrieve (inclusive)
fromnumber0Lowest block height to retrieve (inclusive), defaults to 0
verbosebooleanfalseGet verbose data (not typed!)

Returns

Promise<Item[]>

Implementation of

MultichainClient.listStreamBlockItemsByHeight

Defined in

src/service/Client.ts:267


ping

ping(): Promise<any>

Returns

Promise<any>

Implementation of

MultichainClient.ping

Defined in

src/service/Client.ts:255


setValue

setValue(streamName, streamkey, object): Promise<void>

Parameters

NameType
streamNamestring
streamkeyStreamKey
objectany

Returns

Promise<void>

Implementation of

MultichainClient.setValue

Defined in

src/service/Client.ts:222


streamItems

streamItems(streamId): Promise<StreamItem[]>

Parameters

NameType
streamIdstring

Returns

Promise<StreamItem[]>

Implementation of

MultichainClient.streamItems

Defined in

src/service/Client.ts:96


streams

streams(name?): Promise<Stream[]>

Parameters

NameType
name?string

Returns

Promise<Stream[]>

Implementation of

MultichainClient.streams

Defined in

src/service/Client.ts:83


updateStreamItem

updateStreamItem(streamId, key, object): Promise<string>

Parameters

NameType
streamIdstring
keystring
objectany

Returns

Promise<string>

Implementation of

MultichainClient.updateStreamItem

Defined in

src/service/Client.ts:124


updateValue

updateValue(streamName, key, updateCallback): Promise<void>

Parameters

NameType
streamNamestring
keystring
updateCallback(_: Resource) => Resource

Returns

Promise<void>

Implementation of

MultichainClient.updateValue

Defined in

src/service/Client.ts:227


v2_readStreamItems

v2_readStreamItems(streamName, key, nValues?): Promise<Item[]>

Parameters

NameTypeDefault value
streamNamestringundefined
keystringundefined
nValuesnumbermaxItemCount

Returns

Promise<Item[]>

Implementation of

MultichainClient.v2_readStreamItems

Defined in

src/service/Client.ts:284