14
14
* limitations under the License.
15
15
*/
16
16
17
- import type { Node } from "./commonTypes.js" ;
17
+ /**
18
+ * Peer ID's id as a base58 string (multihash/CIDv0).
19
+ */
20
+ export type PeerIdB58 = string ;
21
+
22
+ /**
23
+ * Node of the Fluence network specified as a pair of node's multiaddr and it's peer id
24
+ */
25
+ export type Node = {
26
+ peerId : PeerIdB58 ;
27
+ multiaddr : string ;
28
+ } ;
18
29
19
30
/**
20
31
* A node in Fluence network a client can connect to.
@@ -37,64 +48,6 @@ export type KeyPairOptions = {
37
48
source : "random" | Uint8Array ;
38
49
} ;
39
50
40
- /**
41
- * Configuration used when initiating Fluence Client
42
- */
43
- export interface ClientConfig {
44
- /**
45
- * Specify the KeyPair to be used to identify the Fluence Peer.
46
- * Will be generated randomly if not specified
47
- */
48
- keyPair ?: KeyPairOptions ;
49
-
50
- /**
51
- * Options to configure the connection to the Fluence network
52
- */
53
- connectionOptions ?: {
54
- /**
55
- * When the peer established the connection to the network it sends a ping-like message to check if it works correctly.
56
- * The options allows to specify the timeout for that message in milliseconds.
57
- * If not specified the default timeout will be used
58
- */
59
- skipCheckConnection ?: boolean ;
60
-
61
- /**
62
- * The dialing timeout in milliseconds
63
- */
64
- dialTimeoutMs ?: number ;
65
-
66
- /**
67
- * The maximum number of inbound streams for the libp2p node.
68
- * Default: 1024
69
- */
70
- maxInboundStreams ?: number ;
71
-
72
- /**
73
- * The maximum number of outbound streams for the libp2p node.
74
- * Default: 1024
75
- */
76
- maxOutboundStreams ?: number ;
77
- } ;
78
-
79
- /**
80
- * Sets the default TTL for all particles originating from the peer with no TTL specified.
81
- * If the originating particle's TTL is defined then that value will be used
82
- * If the option is not set default TTL will be 7000
83
- */
84
- defaultTtlMs ?: number ;
85
-
86
- /**
87
- * Enables\disabled various debugging features
88
- */
89
- debug ?: {
90
- /**
91
- * If set to true, newly initiated particle ids will be printed to console.
92
- * Useful to see what particle id is responsible for aqua function
93
- */
94
- printParticleId ?: boolean ;
95
- } ;
96
- }
97
-
98
51
/**
99
52
* Fluence JS Client connection states as string literals
100
53
*/
@@ -153,3 +106,66 @@ export interface IFluenceClient extends IFluenceInternalApi {
153
106
*/
154
107
getRelayPeerId ( ) : string ;
155
108
}
109
+
110
+ /**
111
+ * Configuration used when initiating Fluence Client
112
+ */
113
+ export interface ClientConfig {
114
+ /**
115
+ * Specify the KeyPair to be used to identify the Fluence Peer.
116
+ * Will be generated randomly if not specified
117
+ */
118
+ keyPair ?: KeyPairOptions ;
119
+
120
+ /**
121
+ * Options to configure the connection to the Fluence network
122
+ */
123
+ connectionOptions ?: {
124
+ /**
125
+ * When the peer established the connection to the network it sends a ping-like message to check if it works correctly.
126
+ * The options allows to specify the timeout for that message in milliseconds.
127
+ * If not specified the default timeout will be used
128
+ */
129
+ skipCheckConnection ?: boolean ;
130
+
131
+ /**
132
+ * The dialing timeout in milliseconds
133
+ */
134
+ dialTimeoutMs ?: number ;
135
+
136
+ /**
137
+ * The maximum number of inbound streams for the libp2p node.
138
+ * Default: 1024
139
+ */
140
+ maxInboundStreams ?: number ;
141
+
142
+ /**
143
+ * The maximum number of outbound streams for the libp2p node.
144
+ * Default: 1024
145
+ */
146
+ maxOutboundStreams ?: number ;
147
+ } ;
148
+
149
+ /**
150
+ * Sets the default TTL for all particles originating from the peer with no TTL specified.
151
+ * If the originating particle's TTL is defined then that value will be used
152
+ * If the option is not set default TTL will be 7000
153
+ */
154
+ defaultTtlMs ?: number ;
155
+
156
+ /**
157
+ * Property for passing custom CDN Url to load dependencies from browser. https://unpkg.com used by default
158
+ */
159
+ CDNUrl ?: string ;
160
+
161
+ /**
162
+ * Enables\disabled various debugging features
163
+ */
164
+ debug ?: {
165
+ /**
166
+ * If set to true, newly initiated particle ids will be printed to console.
167
+ * Useful to see what particle id is responsible for aqua function
168
+ */
169
+ printParticleId ?: boolean ;
170
+ } ;
171
+ }
0 commit comments