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

ConnectionInfo

ConnectionInfo: Object

Type declaration

NameType
allowGzip?boolean
allowInsecureAuthentication?boolean
errorPassThrough?boolean
fetchOptions?Record\<string, string>
headers?{ [key: string]: string | number; }
password?string
skipFetchSetup?boolean
throttleCallback?(attempt: number, url: string) => Promise\<boolean>
throttleLimit?number
throttleSlotInterval?number
timeout?number
urlstring
user?string

DhtAddress

DhtAddress: BrandedString\<"DhtAddress">


EnvironmentId

EnvironmentId: "polygon" | "mumbai" | "dev2"


EthereumAddress

EthereumAddress: BrandedString\<"EthereumAddress">


ExternalProvider

ExternalProvider: Object

Type declaration

NameType
host?string
isMetaMask?boolean
isStatus?boolean
path?string
request?(request: { method: string ; params?: any[] }) => Promise\<any>
send?(request: { method: string ; params?: any[] }, callback: (error: any, response: any) => void) => void
sendAsync?(request: { method: string ; params?: any[] }, callback: (error: any, response: any) => void) => void

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: Signer & { provider: 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


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

formStorageNodeAssignmentStreamId

formStorageNodeAssignmentStreamId(clusterAddress): StreamID

Parameters

NameType
clusterAddressstring

Returns

StreamID