RpcMultichainClient
Api Code Documentation / Exports / service/Client / RpcMultichainClient
service/Client.RpcMultichainClient
Implements
Table of contents
Constructors
Properties
Methods
- getInfo
- getLastBlockInfo
- getLatestValues
- getOrCreateStream
- getPeerInfo
- getRpcClient
- getValue
- getValues
- isValidAddress
- latestValuesForKey
- listBlocksByHeight
- listStreamBlockItemsByHeight
- ping
- setValue
- streamItems
- streams
- updateStreamItem
- updateValue
- v2_readStreamItems
Constructors
constructor
• new RpcMultichainClient(settings
)
Parameters
Name | Type |
---|---|
settings | ConnectionSettings |
Defined in
Properties
hasWriteLock
• Private
hasWriteLock: boolean
Defined in
rpcClient
• Private
rpcClient: RpcClient
Defined in
Methods
getInfo
▸ getInfo(): Promise
<any
>
Returns
Promise
<any
>
Implementation of
Defined in
getLastBlockInfo
▸ getLastBlockInfo(skip?
): Promise
<BlockInfo
>
Get the latest block, possibly skipping a few.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
skip | number | 0 | number of blocks to skip, default 0 (= latest block) |
Returns
Promise
<BlockInfo
>
Implementation of
MultichainClient.getLastBlockInfo
Defined in
getLatestValues
▸ getLatestValues(streamName
, key
, nValues?
): Promise
<StreamItemPair
[]>
Parameters
Name | Type | Default value |
---|---|---|
streamName | string | undefined |
key | string | undefined |
nValues | number | maxItemCount |
Returns
Promise
<StreamItemPair
[]>
Implementation of
MultichainClient.getLatestValues
Defined in
getOrCreateStream
▸ getOrCreateStream(options
): Promise
<string
>
Parameters
Name | Type |
---|---|
options | CreateStreamOptions |
Returns
Promise
<string
>
Implementation of
MultichainClient.getOrCreateStream
Defined in
getPeerInfo
▸ getPeerInfo(): Promise
<PeerInfo
[]>
Returns
Promise
<PeerInfo
[]>
Implementation of
Defined in
getRpcClient
▸ getRpcClient(): RpcClient
Returns
Implementation of
Defined in
getValue
▸ getValue(streamName
, key
): Promise
<StreamItemPair
>
Parameters
Name | Type |
---|---|
streamName | string |
key | string |
Returns
Promise
<StreamItemPair
>
Implementation of
Defined in
getValues
▸ getValues(streamName
, key
, nValues?
): Promise
<StreamItemPair
[]>
Parameters
Name | Type | Default value |
---|---|---|
streamName | string | undefined |
key | string | undefined |
nValues | number | maxItemCount |
Returns
Promise
<StreamItemPair
[]>
Implementation of
Defined in
isValidAddress
▸ isValidAddress(address
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
address | string |
Returns
Promise
<boolean
>
Implementation of
MultichainClient.isValidAddress
Defined in
latestValuesForKey
▸ latestValuesForKey(streamId
, key
, nValues?
): Promise
<any
[]>
Parameters
Name | Type | Default value |
---|---|---|
streamId | string | undefined |
key | string | undefined |
nValues | number | 1 |
Returns
Promise
<any
[]>
Implementation of
MultichainClient.latestValuesForKey
Defined in
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
Name | Type | Default value | Description |
---|---|---|---|
to | number | undefined | highest block height to return (inclusive) |
from | string | number | 0 | lowest block to return (inclusive), defaults to 0 |
verbose | boolean | false | verbose output, defaults to false |
Returns
Promise
<BlockListItem
[]>
Implementation of
MultichainClient.listBlocksByHeight
Defined in
listStreamBlockItemsByHeight
▸ listStreamBlockItemsByHeight(streamName
, to
, from?
, verbose?
): Promise
<Item
[]>
Retrieve all items within a stream by block height range.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
streamName | string | undefined | Stream Name to Read |
to | number | undefined | Highest block height to retrieve (inclusive) |
from | number | 0 | Lowest block height to retrieve (inclusive), defaults to 0 |
verbose | boolean | false | Get verbose data (not typed!) |
Returns
Promise
<Item
[]>
Implementation of
MultichainClient.listStreamBlockItemsByHeight
Defined in
ping
▸ ping(): Promise
<any
>
Returns
Promise
<any
>
Implementation of
Defined in
setValue
▸ setValue(streamName
, streamkey
, object
): Promise
<void
>
Parameters
Name | Type |
---|---|
streamName | string |
streamkey | StreamKey |
object | any |
Returns
Promise
<void
>
Implementation of
Defined in
streamItems
▸ streamItems(streamId
): Promise
<StreamItem
[]>
Parameters
Name | Type |
---|---|
streamId | string |
Returns
Promise
<StreamItem
[]>
Implementation of
Defined in
streams
▸ streams(name?
): Promise
<Stream
[]>
Parameters
Name | Type |
---|---|
name? | string |
Returns
Promise
<Stream
[]>
Implementation of
Defined in
updateStreamItem
▸ updateStreamItem(streamId
, key
, object
): Promise
<string
>
Parameters
Name | Type |
---|---|
streamId | string |
key | string |
object | any |
Returns
Promise
<string
>
Implementation of
MultichainClient.updateStreamItem
Defined in
updateValue
▸ updateValue(streamName
, key
, updateCallback
): Promise
<void
>
Parameters
Name | Type |
---|---|
streamName | string |
key | string |
updateCallback | (_ : Resource ) => Resource |
Returns
Promise
<void
>
Implementation of
Defined in
v2_readStreamItems
▸ v2_readStreamItems(streamName
, key
, nValues?
): Promise
<Item
[]>
Parameters
Name | Type | Default value |
---|---|---|
streamName | string | undefined |
key | string | undefined |
nValues | number | maxItemCount |
Returns
Promise
<Item
[]>
Implementation of
MultichainClient.v2_readStreamItems