Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Ethereum
  • Methods<StreamEndpoints>
  • Methods<Omit<Subscriber, "subscribe">>
  • Methods<StreamRegistry>
  • Methods<Omit<BrubeckNode, "destroy" | "connect">>
  • Methods<LoginEndpoints>
  • Methods<Publisher>
  • Methods<StorageNodeRegistry>
  • Methods<DataUnions>
  • Methods<GroupKeyStoreFactory>
  • Methods<Session>
  • Methods<Resends>
  • StreamrClientBase
    • StreamrClient

Index

Constructors

Properties

Methods Important

Methods Other

Constructors

constructor

Properties

Optional _getAddress

_getAddress?: () => Promise<string>

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

Optional _getDataUnionChainSigner

_getDataUnionChainSigner?: () => Promise<Signer>

Type declaration

    • (): Promise<Signer>
    • Returns Promise<Signer>

Optional _getSigner

_getSigner?: () => Signer

Type declaration

    • (): Signer
    • Returns Signer

Optional _getStreamRegistryChainSigner

_getStreamRegistryChainSigner?: () => Promise<Signer>

Type declaration

    • (): Promise<Signer>
    • Returns Promise<Signer>

cached

cached: StreamEndpointsCached

connect

connect: ((...args: []) => Promise<void>) & { isStarted: any; reset: any } = ...

container

container: default

context

context: Context

dataunions

dataunions: default

debug

debug: Debugger

destroy

destroy: ((...args: []) => Promise<void>) & { isStarted: any; reset: any } = ...

Protected destroySignal

destroySignal: DestroySignal

ethereum

ethereum: StreamrEthereum

getNode

getNode: () => Promise<NetworkNodeStub> = ...

Type declaration

    • (): Promise<NetworkNodeStub>
    • Get started network node.

      Returns Promise<NetworkNodeStub>

getStore

getStore: ((streamId: StreamID) => Promise<default>) & { clear: any }

groupKeyStore

groupKeyStore: default

id

id: string

isDestroyed

isDestroyed: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

loginEndpoints

loginEndpoints: LoginEndpoints

node

node: default

onDestroy

onDestroy: { (): Promise<ArgsType[0]>; <ReturnType>(cb: SignalListener<[]>): ReturnType } & Methods<default<[]>>

options

publisher

publisher: default

resends

resends: default

session

session: default

startNode

startNode: () => Promise<unknown> = ...

Type declaration

    • (): Promise<unknown>
    • Returns Promise<unknown>

storageNodeRegistry

storageNodeRegistry: StorageNodeRegistry

streamEndpoints

streamEndpoints: StreamEndpoints

streamRegistry

streamRegistry: StreamRegistry

subscriber

subscriber: default

unsubscribeAll

unsubscribeAll: (streamDefinition?: StreamDefinition) => Promise<unknown> = ...

Type declaration

    • (streamDefinition?: StreamDefinition): Promise<unknown>
    • Remove all subscriptions, optionally only those matching options.

      Parameters

      • Optional streamDefinition: StreamDefinition

      Returns Promise<unknown>

Static generateEthereumAccount

generateEthereumAccount: () => { address: string; privateKey: string } = ...

Type declaration

    • (): { address: string; privateKey: string }
    • Returns { address: string; privateKey: string }

      • address: string
      • privateKey: string

Important Methods

getOrCreateStream

  • getOrCreateStream(props: { id: string; partitions?: number }): Promise<StreamrStream>
  • Parameters

    • props: { id: string; partitions?: number }
      • id: string
      • Optional partitions?: number

    Returns Promise<StreamrStream>

Other Methods

addListener

  • addListener<T>(event: T, fn: (...args: any[]) => void, context?: any): default
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns default

addStreamToStorageNode

  • addStreamToStorageNode(streamIdOrPath: string, nodeAddress: string): Promise<void>

calculateDataUnionAddresses

  • calculateDataUnionAddresses(dataUnionName: string, deployerAddress?: string): Promise<{ mainnetAddress: string; sidechainAddress: string }>
  • NOTE: if template address is not given, calculation only works for the newest currently deployed factory, i.e. can be used for "future deployments" but NOT for old deployments For old deployments, please use getDataUnion

    Parameters

    • dataUnionName: string
    • Optional deployerAddress: string

    Returns Promise<{ mainnetAddress: string; sidechainAddress: string }>

canEncrypt

  • canEncrypt(): boolean

closePublishProxyConnectionOnStreamPart

  • closePublishProxyConnectionOnStreamPart(streamPartId: StreamPartID, nodeId: string): Promise<void>

collect

  • collect<T>(target: AsyncIterable<default<T>>, n?: number): Promise<T[]>

collectMessages

  • collectMessages<T>(target: AsyncIterable<T>, n?: number): Promise<Awaited<T>[]>

count

  • count(streamDefinition?: StreamDefinition): Promise<number>

countSubscriptionSessions

  • countSubscriptionSessions(): number

createOrUpdateNodeInStorageNodeRegistry

  • createOrUpdateNodeInStorageNodeRegistry(nodeMetadata: string): Promise<void>

createStream

  • createStream(propsOrStreamIdOrPath: string | StreamProperties): Promise<StreamrStream>

deleteStream

  • deleteStream(streamIdOrPath: string): Promise<void>

deployDataUnion

  • Create a new DataUnionMainnet contract to mainnet with DataUnionFactoryMainnet This triggers DataUnionSidechain contract creation in sidechain, over the bridge (AMB)

    Parameters

    Returns Promise<DataUnion>

    Promise that resolves when the new DU is deployed over the bridge to side-chain

disableDebugLogging

  • disableDebugLogging(): void

disconnect

  • disconnect(): Promise<void>

emit

  • emit<T>(event: T, ...args: any[]): boolean
  • Calls each of the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Rest ...args: any[]

    Returns boolean

enableDebugLogging

  • enableDebugLogging(prefix?: string): void

eventNames

  • eventNames(): (string | symbol)[]
  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

from

  • from<T>(streamPartId: StreamPartID, __namedParameters: { fromSequenceNumber?: number; fromTimestamp: number; publisherId?: string }): Promise<MessageStream<T, default<T>, default<T>>>
  • Type parameters

    • T

    Parameters

    • streamPartId: StreamPartID
    • __namedParameters: { fromSequenceNumber?: number; fromTimestamp: number; publisherId?: string }
      • Optional fromSequenceNumber?: number
      • fromTimestamp: number
      • Optional publisherId?: string

    Returns Promise<MessageStream<T, default<T>, default<T>>>

getAddress

  • getAddress(): Promise<string>

getAllBinanceProviders

  • getAllBinanceProviders(): Provider[]

getAllDataUnionChainProviders

  • getAllDataUnionChainProviders(): Provider[]
  • Returns Provider[]

    Array of Ethers.js Provider, connections to the Streamr EVM sidechain

getAllMainnetProviders

  • getAllMainnetProviders(): Provider[]
  • Returns Provider[]

    Array of Ethers.js Providers, connections to the Ethereum network (mainnet)

getAllStorageNodes

  • getAllStorageNodes(): Promise<string[]>

getAllStreamRegistryChainProviders

  • getAllStreamRegistryChainProviders(): Provider[]
  • Returns Provider[]

    Array of Ethers.js Providers, connections to the Stream Registry Chain

getBinanceDepositAddress

  • getBinanceDepositAddress(userAddress: string): Promise<any>

getBinanceOverrides

  • getBinanceOverrides(): Overrides

getBinanceProvider

  • getBinanceProvider(): Provider

getDataUnion

  • getDataUnion(contractAddress: string): Promise<DataUnion>

getDataUnionChainProvider

  • getDataUnionChainProvider(): Provider

getDataUnionChainSigner

  • getDataUnionChainSigner(): Promise<Signer>

getDataUnionOverrides

  • getDataUnionOverrides(): Overrides

getMainnetOverrides

  • getMainnetOverrides(): Overrides

getMainnetProvider

  • getMainnetProvider(): Provider

getNodeId

  • getNodeId(): Promise<string>

getPermissions

  • getPermissions(streamIdOrPath: string): Promise<PermissionAssignment[]>

getSessionToken

  • getSessionToken(requireNewToken?: boolean): Promise<string>

getSidechainTokenBalance

  • getSidechainTokenBalance(address: string): Promise<BigNumber>
  • Get token balance in "wei" (10^-18 parts) for given address in sidechain

    Parameters

    • address: string

    Returns Promise<BigNumber>

getSigner

  • getSigner(): Signer

getStorageNodeUrl

  • getStorageNodeUrl(nodeAddress: string): Promise<string>

getStorageNodesOf

  • getStorageNodesOf(streamIdOrPath: string): Promise<string[]>

getStoredStreamsOf

  • getStoredStreamsOf(nodeAddress: string): Promise<{ blockNumber: number; streams: StreamrStream[] }>

getStream

  • getStream(streamIdOrPath: string): Promise<StreamrStream>

getStreamFromContract

  • getStreamFromContract(streamIdOrPath: string): Promise<StreamrStream>

getStreamFromGraph

  • getStreamFromGraph(streamIdOrPath: string): Promise<StreamrStream>

getStreamLast

  • getStreamLast(streamDefinition: StreamDefinition, count?: number): Promise<StreamMessageAsObject[]>

getStreamPartsByStorageNode

  • getStreamPartsByStorageNode(nodeAddress: string): Promise<StreamPartID[]>

getStreamPublishers

  • getStreamPublishers(streamIdOrPath: string): AsyncGenerator<string, any, unknown>

getStreamRegistryChainProvider

  • getStreamRegistryChainProvider(): Provider
  • Returns Provider

    Ethers.js Provider, a connection to the Stream Registry Chain

getStreamRegistryChainSigner

  • getStreamRegistryChainSigner(): Promise<Signer>

getStreamRegistryOverrides

  • getStreamRegistryOverrides(): Overrides

getStreamSubscribers

  • getStreamSubscribers(streamIdOrPath: string): AsyncGenerator<string, any, unknown>

getSubscriptions

  • getSubscriptions(streamDefinition?: StreamDefinition): Promise<Subscription<unknown>[]>
  • Get subscriptions matching streamId or streamId + streamPartition

    Parameters

    • Optional streamDefinition: StreamDefinition

    Returns Promise<Subscription<unknown>[]>

getTokenBalance

  • getTokenBalance(address: string): Promise<BigNumber>

getUserInfo

  • getUserInfo(): Promise<UserDetails>

grantPermissions

  • grantPermissions(streamIdOrPath: string, ...assignments: PermissionAssignment[]): Promise<void>

hasPermission

  • hasPermission(query: PermissionQuery): Promise<boolean>

isAuthenticated

  • isAuthenticated(): boolean

isStreamPublisher

  • isStreamPublisher(streamIdOrPath: string, userAddress: string): Promise<boolean>

isStreamStoredInStorageNode

  • isStreamStoredInStorageNode(streamIdOrPath: string, nodeAddress: string): Promise<boolean>

isStreamStoredInStorageNodeFromContract

  • isStreamStoredInStorageNodeFromContract(streamIdOrPath: string, nodeAddress: string): Promise<boolean>

isStreamSubscriber

  • isStreamSubscriber(streamIdOrPath: string, userAddress: string): Promise<boolean>

isUnauthenticated

  • isUnauthenticated(): boolean

listenerCount

  • listenerCount(event: string | symbol): number
  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners<T>(event: T): ((...args: any[]) => void)[]
  • Return the listeners registered for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T

    Returns ((...args: any[]) => void)[]

logout

  • logout(): Promise<void>

off

  • off<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): default
  • Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns default

on

  • on<T>(event: T, fn: (...args: any[]) => void, context?: any): default
  • Add a listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns default

once

  • once<T>(event: T, fn: (...args: any[]) => void, context?: any): default
  • Add a one-time listener for a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any

    Returns default

openPublishProxyConnectionOnStreamPart

  • openPublishProxyConnectionOnStreamPart(streamPartId: StreamPartID, nodeId: string): Promise<void>

publish

  • publish<T>(streamDefinition: StreamDefinition, content: T, timestamp?: string | number | Date, partitionKey?: string | number): Promise<default<T>>
  • Type parameters

    • T

    Parameters

    • streamDefinition: StreamDefinition
    • content: T
    • timestamp: string | number | Date = ...
    • Optional partitionKey: string | number

    Returns Promise<default<T>>

publishHttp

  • publishHttp(nodeUrl: string, streamIdOrPath: string, data: any, requestOptions?: any, keepAlive?: boolean): Promise<void>
  • Parameters

    • nodeUrl: string
    • streamIdOrPath: string
    • data: any
    • requestOptions: any = {}
    • keepAlive: boolean = true

    Returns Promise<void>

publishMessage

  • publishMessage<T>(streamDefinition: StreamDefinition, __namedParameters: PublishMetadata<T>): Promise<default<T>>
  • Type parameters

    • T

    Parameters

    • streamDefinition: StreamDefinition
    • __namedParameters: PublishMetadata<T>

    Returns Promise<default<T>>

publishToNode

  • publishToNode(streamMessage: default<unknown>): void | Promise<void>
  • Calls publish on node after starting it. Basically a wrapper around: (await getNode()).publish(…) but will be sync in case that node is already started. Zalgo intentional. See below.

    Parameters

    • streamMessage: default<unknown>

    Returns void | Promise<void>

range

  • range<T>(streamPartId: StreamPartID, __namedParameters: { fromSequenceNumber?: number; fromTimestamp: number; msgChainId?: string; publisherId?: string; toSequenceNumber?: number; toTimestamp: number }): Promise<MessageStream<T, default<T>, default<T>>>
  • Type parameters

    • T

    Parameters

    • streamPartId: StreamPartID
    • __namedParameters: { fromSequenceNumber?: number; fromTimestamp: number; msgChainId?: string; publisherId?: string; toSequenceNumber?: number; toTimestamp: number }
      • Optional fromSequenceNumber?: number
      • fromTimestamp: number
      • Optional msgChainId?: string
      • Optional publisherId?: string
      • Optional toSequenceNumber?: number
      • toTimestamp: number

    Returns Promise<MessageStream<T, default<T>, default<T>>>

registerStorageEventListener

  • registerStorageEventListener(callback: (event: StorageNodeAssignmentEvent) => any): Promise<void>
  • Parameters

    • callback: (event: StorageNodeAssignmentEvent) => any
        • (event: StorageNodeAssignmentEvent): any
        • Parameters

          • event: StorageNodeAssignmentEvent

          Returns any

    Returns Promise<void>

rekey

  • rekey(streamId: StreamID): Promise<void>

removeAllListeners

  • removeAllListeners(event?: string | symbol): default
  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: string | symbol

    Returns default

removeListener

  • removeListener<T>(event: T, fn?: (...args: any[]) => void, context?: any, once?: boolean): default
  • Remove the listeners of a given event.

    Type parameters

    • T: string | symbol

    Parameters

    • event: T
    • Optional fn: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns default

removeNodeFromStorageNodeRegistry

  • removeNodeFromStorageNodeRegistry(): Promise<void>

removePublishProxies

  • removePublishProxies(streamDefinition: StreamDefinition, nodeIds: string[]): Promise<void>

removePublishProxy

  • removePublishProxy(streamDefinition: StreamDefinition, nodeId: string): Promise<void>

removeStreamFromStorageNode

  • removeStreamFromStorageNode(streamIdOrPath: string, nodeAddress: string): Promise<void>

resend

  • resend<T>(streamDefinition: StreamDefinition, options: ResendOptions, onMessage?: MessageStreamOnMessage<T, unknown>): Promise<MessageStream<T, default<T>, default<T>>>
  • Call last/from/range as appropriate based on arguments

    Type parameters

    • T

    Parameters

    • streamDefinition: StreamDefinition
    • options: ResendOptions
    • Optional onMessage: MessageStreamOnMessage<T, unknown>

    Returns Promise<MessageStream<T, default<T>, default<T>>>

revokePermissions

  • revokePermissions(streamIdOrPath: string, ...assignments: PermissionAssignment[]): Promise<void>

rotateGroupKey

  • rotateGroupKey(streamId: StreamID): Promise<void>

searchStreams

  • searchStreams(term: undefined | string, permissionFilter: undefined | SearchStreamsPermissionFilter): AsyncGenerator<StreamrStream, any, unknown>
  • Parameters

    • term: undefined | string
    • permissionFilter: undefined | SearchStreamsPermissionFilter

    Returns AsyncGenerator<StreamrStream, any, unknown>

sendLogin

  • sendLogin(): Promise<TokenObject>

setBinanceDepositAddress

  • setBinanceDepositAddress(binanceRecipient: string): Promise<TransactionReceipt>

setBinanceDepositAddressFromSignature

  • setBinanceDepositAddressFromSignature(from: string, binanceRecipient: string, signature: BytesLike): Promise<TransactionReceipt>
  • Parameters

    • from: string
    • binanceRecipient: string
    • signature: BytesLike

    Returns Promise<TransactionReceipt>

setBinanceDepositAddressViaWithdrawServer

  • setBinanceDepositAddressViaWithdrawServer(from: string, binanceRecipient: string, signature: BytesLike): Promise<object>

setNextGroupKey

  • setNextGroupKey(streamId: StreamID, newKey: GroupKey): Promise<void>

setPermissions

  • setPermissions(...items: { assignments: PermissionAssignment[]; streamId: string }[]): Promise<void>

setPublishProxies

  • setPublishProxies(streamDefinition: StreamDefinition, nodeIds: string[]): Promise<void>

setPublishProxy

  • setPublishProxy(streamDefinition: StreamDefinition, nodeId: string): Promise<void>

signSetBinanceRecipient

  • signSetBinanceRecipient(recipientAddress: string): Promise<string>

start

  • start(): Promise<void>

startKeyExchange

  • startKeyExchange(): Promise<void>

stop

  • stop(): Promise<void>

stopKeyExchange

  • stopKeyExchange(): Promise<void>

streamExistsOnChain

  • streamExistsOnChain(streamIdOrPath: string): Promise<boolean>

streamExistsOnTheGraph

  • streamExistsOnTheGraph(streamIdOrPath: string): Promise<boolean>

subscribe

  • subscribe<T>(options: (string & { resend: ResendOptions }) & ({ id: string; partition?: number } & { resend: ResendOptions }) & ({ partition?: number; stream: string } & { resend: ResendOptions }) & ({ partition?: number; streamId: string } & { resend: ResendOptions }), onMessage?: MessageStreamOnMessage<T, unknown>): Promise<ResendSubscription<T>>
  • subscribe<T>(options: StreamDefinition, onMessage?: MessageStreamOnMessage<T, unknown>): Promise<Subscription<T>>
  • Type parameters

    • T

    Parameters

    • options: (string & { resend: ResendOptions }) & ({ id: string; partition?: number } & { resend: ResendOptions }) & ({ partition?: number; stream: string } & { resend: ResendOptions }) & ({ partition?: number; streamId: string } & { resend: ResendOptions })
    • Optional onMessage: MessageStreamOnMessage<T, unknown>

    Returns Promise<ResendSubscription<T>>

  • Type parameters

    • T

    Parameters

    • options: StreamDefinition
    • Optional onMessage: MessageStreamOnMessage<T, unknown>

    Returns Promise<Subscription<T>>

subscribeTo

  • subscribeTo<T>(streamPartId: StreamPartID, onMessage?: MessageStreamOnMessage<T, unknown>): Promise<Subscription<T>>

unRegisterStorageEventListeners

  • unRegisterStorageEventListeners(): Promise<void>

unsubscribe

  • unsubscribe(streamDefinitionOrSubscription?: StreamDefinition | Subscription<unknown>): Promise<unknown>

updateState

  • updateState(newState: State): void

updateStream

  • updateStream(props: StreamProperties): Promise<StreamrStream>

useGroupKey

  • useGroupKey(streamId: StreamID): Promise<[undefined | GroupKey, undefined | GroupKey]>

waitForStorage

  • waitForStorage(streamMessage: default<unknown>, __namedParameters?: { count?: number; interval?: number; timeout?: number; messageMatchFn?: any }): Promise<void>
  • Parameters

    • streamMessage: default<unknown>
    • __namedParameters: { count?: number; interval?: number; timeout?: number; messageMatchFn?: any } = {}
      • Optional count?: number
      • Optional interval?: number
      • Optional timeout?: number
      • messageMatchFn?:function
        • messageMatchFn(msgTarget: default<unknown>, msgGot: default<unknown>): boolean

    Returns Promise<void>

Generated using TypeDoc