@@ -8,7 +8,7 @@ import type {
8
8
IAsyncIterator ,
9
9
IDecodedMessage ,
10
10
IDecoder ,
11
- IFilterV2 ,
11
+ IFilter ,
12
12
IProtoMessage ,
13
13
IReceiver ,
14
14
Libp2p ,
@@ -25,8 +25,8 @@ import all from "it-all";
25
25
import * as lp from "it-length-prefixed" ;
26
26
import { pipe } from "it-pipe" ;
27
27
28
- import { BaseProtocol } from "../../ base_protocol.js" ;
29
- import { DefaultPubSubTopic } from "../../ constants.js" ;
28
+ import { BaseProtocol } from "../base_protocol.js" ;
29
+ import { DefaultPubSubTopic } from "../constants.js" ;
30
30
31
31
import {
32
32
FilterPushRpc ,
@@ -41,7 +41,7 @@ type SubscriptionCallback<T extends IDecodedMessage> = {
41
41
callback : Callback < T > ;
42
42
} ;
43
43
44
- const FilterV2Codecs = {
44
+ const FilterCodecs = {
45
45
SUBSCRIBE : "/vac/waku/filter-subscribe/2.0.0-beta1" ,
46
46
PUSH : "/vac/waku/filter-push/2.0.0-beta1" ,
47
47
} ;
@@ -225,7 +225,7 @@ class Subscription {
225
225
}
226
226
}
227
227
228
- class FilterV2 extends BaseProtocol implements IReceiver {
228
+ class Filter extends BaseProtocol implements IReceiver {
229
229
private readonly options : ProtocolCreateOptions ;
230
230
private activeSubscriptions = new Map < string , Subscription > ( ) ;
231
231
@@ -246,10 +246,10 @@ class FilterV2 extends BaseProtocol implements IReceiver {
246
246
}
247
247
248
248
constructor ( libp2p : Libp2p , options ?: ProtocolCreateOptions ) {
249
- super ( FilterV2Codecs . SUBSCRIBE , libp2p . components ) ;
249
+ super ( FilterCodecs . SUBSCRIBE , libp2p . components ) ;
250
250
251
- libp2p . handle ( FilterV2Codecs . PUSH , this . onRequest . bind ( this ) ) . catch ( ( e ) => {
252
- log ( "Failed to register " , FilterV2Codecs . PUSH , e ) ;
251
+ libp2p . handle ( FilterCodecs . PUSH , this . onRequest . bind ( this ) ) . catch ( ( e ) => {
252
+ log ( "Failed to register " , FilterCodecs . PUSH , e ) ;
253
253
} ) ;
254
254
255
255
this . activeSubscriptions = new Map ( ) ;
@@ -365,10 +365,10 @@ class FilterV2 extends BaseProtocol implements IReceiver {
365
365
}
366
366
}
367
367
368
- export function wakuFilterV2 (
368
+ export function wakuFilter (
369
369
init : Partial < ProtocolCreateOptions > = { }
370
- ) : ( libp2p : Libp2p ) => IFilterV2 {
371
- return ( libp2p : Libp2p ) => new FilterV2 ( libp2p , init ) ;
370
+ ) : ( libp2p : Libp2p ) => IFilter {
371
+ return ( libp2p : Libp2p ) => new Filter ( libp2p , init ) ;
372
372
}
373
373
374
374
async function pushMessage < T extends IDecodedMessage > (
0 commit comments