Skip to main content

API reference

Streamr SDK version 1.0

Classes

Interfaces

Enums

Type Aliases

BrandedString

BrandedString\<T>: string & { __brand: T }

Type parameters

Name
T

DhtAddress

DhtAddress: BrandedString\<"DhtAddress">


EnvironmentId

EnvironmentId: "polygon" | "polygonAmoy" | "dev2"


EthereumAddress

EthereumAddress: BrandedString\<"EthereumAddress">


GapFillStrategy

GapFillStrategy: "light" | "full"


LogLevel

LogLevel: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace"


MessageListener

MessageListener: (content: unknown, metadata: MessageMetadata) => unknown | Promise\<unknown>

Type declaration

▸ (content, metadata): unknown | Promise\<unknown>

Parameters
NameType
contentunknown
metadataMessageMetadata
Returns

unknown | Promise\<unknown>


MessageMetadata

MessageMetadata: Omit\<Message, "content">


MetricsDefinition

MetricsDefinition: Record\<string, Metric>


MetricsReport

MetricsReport: { period: { end: number ; start: number } } & Record\<string, any>


PermissionAssignment

PermissionAssignment: UserPermissionAssignment | PublicPermissionAssignment


PermissionQuery

PermissionQuery: UserPermissionQuery | PublicPermissionQuery


ResendOptions

ResendOptions: ResendLastOptions | ResendFromOptions | ResendRangeOptions

The supported resend types.


SignerWithProvider

SignerWithProvider: AbstractSigner\<Provider>


StreamDefinition

StreamDefinition: string | { id: string ; partition?: number } | { partition?: number ; stream: string } | { partition?: number ; streamId: string }


StreamID

StreamID: BrandedString\<"StreamID">


StreamMessageAESEncrypted

StreamMessageAESEncrypted: StreamMessage & { encryptionType: AES ; groupKeyId: string }

Encrypted StreamMessage.


StreamPartID

StreamPartID: BrandedString\<"StreamPartID">


StrictStreamrClientConfig

StrictStreamrClientConfig: MarkOptional\<Required\<StreamrClientConfig>, "environment" | "auth" | "metrics"> & { cache: Exclude\<Required\<StreamrClientConfig["cache"]>, undefined> ; contracts: Exclude\<Required\<StreamrClientConfig["contracts"]>, undefined> ; encryption: Exclude\<Required\<StreamrClientConfig["encryption"]>, undefined> ; network: Exclude\<Required\<StreamrClientConfig["network"]>, undefined> }


SubscribeOptions

SubscribeOptions: StreamDefinition & ExtraSubscribeOptions

Variables

CONFIG_TEST

Const CONFIG_TEST: StreamrClientConfig

Streamr client constructor options that work in the test environment


OperatorDiscoveryRequest

OperatorDiscoveryRequest: OperatorDiscoveryRequest$Type

Generated

MessageType for protobuf message OperatorDiscoveryRequest


OperatorDiscoveryResponse

OperatorDiscoveryResponse: OperatorDiscoveryResponse$Type

Generated

MessageType for protobuf message OperatorDiscoveryResponse


PeerDescriptor

PeerDescriptor: PeerDescriptor$Type

Generated

MessageType for protobuf message dht.PeerDescriptor


STREAMR_STORAGE_NODE_GERMANY

Const STREAMR_STORAGE_NODE_GERMANY: "0x31546eEA76F2B2b3C5cC06B1c93601dc35c9D916"


VALID_FIELD_TYPES

Const VALID_FIELD_TYPES: readonly ["number", "string", "boolean", "list", "map"]

Functions

convertBytesToStreamMessage

convertBytesToStreamMessage(bytes): StreamMessage

Parameters

NameType
bytesUint8Array

Returns

StreamMessage


convertStreamMessageToBytes

convertStreamMessageToBytes(oldStreamMessage): Uint8Array

Parameters

NameType
oldStreamMessageStreamMessage

Returns

Uint8Array


formStorageNodeAssignmentStreamId

formStorageNodeAssignmentStreamId(clusterAddress): StreamID

Parameters

NameType
clusterAddressstring

Returns

StreamID


peerDescriptorTranslator

peerDescriptorTranslator(json): PeerDescriptor

Parameters

NameType
jsonNetworkPeerDescriptor

Returns

PeerDescriptor