Danish Arora 8deab11890
chore(lightpush)!: move protocol implementation opinions to @waku/sdk (#1887)
* chore: restructure @waku/sdk

* chore: introduce `BaseProtocolCore` and `BaseProtocolSDK`

* chore: introduce `LightPushCore` and `LightPushSDK`

* chore: update `relay` for new types

* chore(sdk): update structure

* chore(filter): add `numPeersToUse`

* chore: update tests

* update: size-limit

* chore: update more tests

* attach issue link to TODOs
2024-03-11 18:50:34 +05:30

16 lines
334 B
TypeScript

import { IBaseProtocolSDK } from "..";
interface Options {
numPeersToUse?: number;
}
const DEFAULT_NUM_PEERS_TO_USE = 3;
export class BaseProtocolSDK implements IBaseProtocolSDK {
public readonly numPeers: number;
constructor(options: Options) {
this.numPeers = options?.numPeersToUse ?? DEFAULT_NUM_PEERS_TO_USE;
}
}