Skip to main content

OmniaSwarmImpl

@totemsdk/omnia


@totemsdk/omnia / OmniaSwarmImpl

Class: OmniaSwarmImpl

Implements​

Constructors​

Constructor​

new OmniaSwarmImpl(swarm, config?): OmniaSwarmImpl

Parameters​

swarm​

any

config?​

OmniaSwarmConfig = {}

Returns​

OmniaSwarmImpl

Methods​

advertise(localPubkey): void

Parameters​

localPubkey​

string

Returns​

void

Implementation of​

OmniaSwarm.advertise


broadcast()​

broadcast(topic, msg): Promise<void>

Parameters​

topic​

string

msg​

OmniaMessage

Returns​

Promise<void>

Implementation of​

OmniaSwarm.broadcast


close()​

close(): Promise<void>

Returns​

Promise<void>

Implementation of​

OmniaSwarm.close


connectToPeer()​

connectToPeer(pubkey, channelId?): Promise<OmniaPeer>

Parameters​

pubkey​

string

channelId?​

string

Returns​

Promise<OmniaPeer>

Implementation of​

OmniaSwarm.connectToPeer


listenForChannels()​

listenForChannels(onProposal): Unsubscribe

Parameters​

onProposal​

(peer, proposal) => void

Returns​

Unsubscribe

Implementation of​

OmniaSwarm.listenForChannels