-
Notifications
You must be signed in to change notification settings - Fork 443
/
index.ts
43 lines (36 loc) · 1.13 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { Multiaddr } from '@multiformats/multiaddr'
export interface AddressManager {
/**
* Get peer listen multiaddrs
*/
getListenAddrs(): Multiaddr[]
/**
* Get peer announcing multiaddrs
*/
getAnnounceAddrs(): Multiaddr[]
/**
* Get observed multiaddrs - these addresses may not have been confirmed as
* publicly dialable yet
*/
getObservedAddrs(): Multiaddr[]
/**
* Signal that we have confidence an observed multiaddr is publicly dialable -
* this will make it appear in the output of getAddresses()
*/
confirmObservedAddr(addr: Multiaddr): void
/**
* Signal that we do not have confidence an observed multiaddr is publicly dialable -
* this will remove it from the output of getObservedAddrs()
*/
removeObservedAddr(addr: Multiaddr): void
/**
* Add peer observed addresses. These will then appear in the output of getObservedAddrs
* but not getAddresses() until their dialability has been confirmed via a call to
* confirmObservedAddr.
*/
addObservedAddr(addr: Multiaddr): void
/**
* Get the current node's addresses
*/
getAddresses(): Multiaddr[]
}