libp2p 0.36.2-cc60cfd → 0.36.2-fab4f13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/circuit/circuit/hop.d.ts +3 -3
- package/dist/src/circuit/circuit/hop.d.ts.map +1 -1
- package/dist/src/circuit/circuit/hop.js +1 -1
- package/dist/src/circuit/circuit/hop.js.map +1 -1
- package/dist/src/circuit/circuit/stop.d.ts +3 -3
- package/dist/src/circuit/circuit/stop.d.ts.map +1 -1
- package/dist/src/circuit/circuit/stop.js.map +1 -1
- package/dist/src/circuit/circuit/stream-handler.d.ts +4 -4
- package/dist/src/circuit/circuit/stream-handler.d.ts.map +1 -1
- package/dist/src/circuit/circuit/stream-handler.js +2 -3
- package/dist/src/circuit/circuit/stream-handler.js.map +1 -1
- package/dist/src/circuit/circuit/utils.d.ts +2 -2
- package/dist/src/circuit/circuit/utils.d.ts.map +1 -1
- package/dist/src/circuit/circuit/utils.js.map +1 -1
- package/dist/src/circuit/pb/index.d.ts +42 -164
- package/dist/src/circuit/pb/index.d.ts.map +1 -0
- package/dist/src/circuit/pb/index.js +67 -523
- package/dist/src/circuit/pb/index.js.map +1 -0
- package/dist/src/dht/dummy-dht.d.ts +17 -0
- package/dist/src/dht/dummy-dht.d.ts.map +1 -0
- package/dist/src/dht/dummy-dht.js +39 -0
- package/dist/src/dht/dummy-dht.js.map +1 -0
- package/dist/src/dialer/index.d.ts.map +1 -1
- package/dist/src/dialer/index.js +0 -1
- package/dist/src/dialer/index.js.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +2 -0
- package/dist/src/errors.js.map +1 -1
- package/dist/src/fetch/index.d.ts.map +1 -1
- package/dist/src/fetch/index.js +5 -6
- package/dist/src/fetch/index.js.map +1 -1
- package/dist/src/fetch/pb/proto.d.ts +20 -128
- package/dist/src/fetch/pb/proto.d.ts.map +1 -0
- package/dist/src/fetch/pb/proto.js +44 -331
- package/dist/src/fetch/pb/proto.js.map +1 -0
- package/dist/src/identify/index.d.ts +4 -2
- package/dist/src/identify/index.d.ts.map +1 -1
- package/dist/src/identify/index.js +8 -8
- package/dist/src/identify/index.js.map +1 -1
- package/dist/src/identify/pb/message.d.ts +13 -108
- package/dist/src/identify/pb/message.d.ts.map +1 -0
- package/dist/src/identify/pb/message.js +21 -366
- package/dist/src/identify/pb/message.js.map +1 -0
- package/dist/src/index.d.ts +11 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/insecure/index.d.ts.map +1 -1
- package/dist/src/insecure/index.js +5 -2
- package/dist/src/insecure/index.js.map +1 -1
- package/dist/src/insecure/pb/proto.d.ts +24 -130
- package/dist/src/insecure/pb/proto.d.ts.map +1 -0
- package/dist/src/insecure/pb/proto.js +46 -388
- package/dist/src/insecure/pb/proto.js.map +1 -0
- package/dist/src/keychain/index.d.ts +3 -3
- package/dist/src/keychain/index.js +2 -2
- package/dist/src/keychain/util.d.ts +1 -1
- package/dist/src/keychain/util.d.ts.map +1 -1
- package/dist/src/libp2p.d.ts +7 -4
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js +20 -5
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/metrics/stats.d.ts +1 -5
- package/dist/src/metrics/stats.d.ts.map +1 -1
- package/dist/src/metrics/stats.js.map +1 -1
- package/dist/src/pubsub/dummy-pubsub.d.ts +17 -0
- package/dist/src/pubsub/dummy-pubsub.d.ts.map +1 -0
- package/dist/src/pubsub/dummy-pubsub.js +37 -0
- package/dist/src/pubsub/dummy-pubsub.js.map +1 -0
- package/package.json +45 -44
- package/src/circuit/circuit/hop.ts +4 -4
- package/src/circuit/circuit/stop.ts +3 -3
- package/src/circuit/circuit/stream-handler.ts +5 -6
- package/src/circuit/circuit/utils.ts +2 -2
- package/src/circuit/pb/index.proto +1 -1
- package/src/circuit/pb/index.ts +88 -0
- package/src/dht/dummy-dht.ts +51 -0
- package/src/dialer/index.ts +0 -3
- package/src/errors.ts +2 -0
- package/src/fetch/index.ts +6 -7
- package/src/fetch/pb/proto.ts +58 -0
- package/src/identify/index.ts +10 -10
- package/src/identify/pb/message.ts +36 -0
- package/src/index.ts +12 -5
- package/src/insecure/index.ts +8 -4
- package/src/insecure/pb/proto.ts +61 -0
- package/src/keychain/index.ts +2 -2
- package/src/libp2p.ts +27 -9
- package/src/metrics/stats.ts +1 -6
- package/src/pubsub/dummy-pubsub.ts +51 -0
- package/src/circuit/pb/index.d.ts +0 -173
- package/src/circuit/pb/index.js +0 -528
- package/src/fetch/pb/proto.d.ts +0 -134
- package/src/fetch/pb/proto.js +0 -331
- package/src/identify/pb/message.d.ts +0 -110
- package/src/identify/pb/message.js +0 -369
- package/src/insecure/pb/proto.d.ts +0 -134
- package/src/insecure/pb/proto.js +0 -388
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
/*eslint-disable*/
|
|
2
|
-
import $protobuf from "protobufjs/minimal.js";
|
|
3
|
-
|
|
4
|
-
// Common aliases
|
|
5
|
-
const $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
|
|
6
|
-
|
|
7
|
-
// Exported root namespace
|
|
8
|
-
const $root = $protobuf.roots["libp2p-identify"] || ($protobuf.roots["libp2p-identify"] = {});
|
|
9
|
-
|
|
10
|
-
export const Identify = $root.Identify = (() => {
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Properties of an Identify.
|
|
14
|
-
* @exports IIdentify
|
|
15
|
-
* @interface IIdentify
|
|
16
|
-
* @property {string|null} [protocolVersion] Identify protocolVersion
|
|
17
|
-
* @property {string|null} [agentVersion] Identify agentVersion
|
|
18
|
-
* @property {Uint8Array|null} [publicKey] Identify publicKey
|
|
19
|
-
* @property {Array.<Uint8Array>|null} [listenAddrs] Identify listenAddrs
|
|
20
|
-
* @property {Uint8Array|null} [observedAddr] Identify observedAddr
|
|
21
|
-
* @property {Array.<string>|null} [protocols] Identify protocols
|
|
22
|
-
* @property {Uint8Array|null} [signedPeerRecord] Identify signedPeerRecord
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Constructs a new Identify.
|
|
27
|
-
* @exports Identify
|
|
28
|
-
* @classdesc Represents an Identify.
|
|
29
|
-
* @implements IIdentify
|
|
30
|
-
* @constructor
|
|
31
|
-
* @param {IIdentify=} [p] Properties to set
|
|
32
|
-
*/
|
|
33
|
-
function Identify(p) {
|
|
34
|
-
this.listenAddrs = [];
|
|
35
|
-
this.protocols = [];
|
|
36
|
-
if (p)
|
|
37
|
-
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
|
|
38
|
-
if (p[ks[i]] != null)
|
|
39
|
-
this[ks[i]] = p[ks[i]];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Identify protocolVersion.
|
|
44
|
-
* @member {string|null|undefined} protocolVersion
|
|
45
|
-
* @memberof Identify
|
|
46
|
-
* @instance
|
|
47
|
-
*/
|
|
48
|
-
Identify.prototype.protocolVersion = null;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Identify agentVersion.
|
|
52
|
-
* @member {string|null|undefined} agentVersion
|
|
53
|
-
* @memberof Identify
|
|
54
|
-
* @instance
|
|
55
|
-
*/
|
|
56
|
-
Identify.prototype.agentVersion = null;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Identify publicKey.
|
|
60
|
-
* @member {Uint8Array|null|undefined} publicKey
|
|
61
|
-
* @memberof Identify
|
|
62
|
-
* @instance
|
|
63
|
-
*/
|
|
64
|
-
Identify.prototype.publicKey = null;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Identify listenAddrs.
|
|
68
|
-
* @member {Array.<Uint8Array>} listenAddrs
|
|
69
|
-
* @memberof Identify
|
|
70
|
-
* @instance
|
|
71
|
-
*/
|
|
72
|
-
Identify.prototype.listenAddrs = $util.emptyArray;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Identify observedAddr.
|
|
76
|
-
* @member {Uint8Array|null|undefined} observedAddr
|
|
77
|
-
* @memberof Identify
|
|
78
|
-
* @instance
|
|
79
|
-
*/
|
|
80
|
-
Identify.prototype.observedAddr = null;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Identify protocols.
|
|
84
|
-
* @member {Array.<string>} protocols
|
|
85
|
-
* @memberof Identify
|
|
86
|
-
* @instance
|
|
87
|
-
*/
|
|
88
|
-
Identify.prototype.protocols = $util.emptyArray;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Identify signedPeerRecord.
|
|
92
|
-
* @member {Uint8Array|null|undefined} signedPeerRecord
|
|
93
|
-
* @memberof Identify
|
|
94
|
-
* @instance
|
|
95
|
-
*/
|
|
96
|
-
Identify.prototype.signedPeerRecord = null;
|
|
97
|
-
|
|
98
|
-
// OneOf field names bound to virtual getters and setters
|
|
99
|
-
let $oneOfFields;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Identify _protocolVersion.
|
|
103
|
-
* @member {"protocolVersion"|undefined} _protocolVersion
|
|
104
|
-
* @memberof Identify
|
|
105
|
-
* @instance
|
|
106
|
-
*/
|
|
107
|
-
Object.defineProperty(Identify.prototype, "_protocolVersion", {
|
|
108
|
-
get: $util.oneOfGetter($oneOfFields = ["protocolVersion"]),
|
|
109
|
-
set: $util.oneOfSetter($oneOfFields)
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Identify _agentVersion.
|
|
114
|
-
* @member {"agentVersion"|undefined} _agentVersion
|
|
115
|
-
* @memberof Identify
|
|
116
|
-
* @instance
|
|
117
|
-
*/
|
|
118
|
-
Object.defineProperty(Identify.prototype, "_agentVersion", {
|
|
119
|
-
get: $util.oneOfGetter($oneOfFields = ["agentVersion"]),
|
|
120
|
-
set: $util.oneOfSetter($oneOfFields)
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Identify _publicKey.
|
|
125
|
-
* @member {"publicKey"|undefined} _publicKey
|
|
126
|
-
* @memberof Identify
|
|
127
|
-
* @instance
|
|
128
|
-
*/
|
|
129
|
-
Object.defineProperty(Identify.prototype, "_publicKey", {
|
|
130
|
-
get: $util.oneOfGetter($oneOfFields = ["publicKey"]),
|
|
131
|
-
set: $util.oneOfSetter($oneOfFields)
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Identify _observedAddr.
|
|
136
|
-
* @member {"observedAddr"|undefined} _observedAddr
|
|
137
|
-
* @memberof Identify
|
|
138
|
-
* @instance
|
|
139
|
-
*/
|
|
140
|
-
Object.defineProperty(Identify.prototype, "_observedAddr", {
|
|
141
|
-
get: $util.oneOfGetter($oneOfFields = ["observedAddr"]),
|
|
142
|
-
set: $util.oneOfSetter($oneOfFields)
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Identify _signedPeerRecord.
|
|
147
|
-
* @member {"signedPeerRecord"|undefined} _signedPeerRecord
|
|
148
|
-
* @memberof Identify
|
|
149
|
-
* @instance
|
|
150
|
-
*/
|
|
151
|
-
Object.defineProperty(Identify.prototype, "_signedPeerRecord", {
|
|
152
|
-
get: $util.oneOfGetter($oneOfFields = ["signedPeerRecord"]),
|
|
153
|
-
set: $util.oneOfSetter($oneOfFields)
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Encodes the specified Identify message. Does not implicitly {@link Identify.verify|verify} messages.
|
|
158
|
-
* @function encode
|
|
159
|
-
* @memberof Identify
|
|
160
|
-
* @static
|
|
161
|
-
* @param {IIdentify} m Identify message or plain object to encode
|
|
162
|
-
* @param {$protobuf.Writer} [w] Writer to encode to
|
|
163
|
-
* @returns {$protobuf.Writer} Writer
|
|
164
|
-
*/
|
|
165
|
-
Identify.encode = function encode(m, w) {
|
|
166
|
-
if (!w)
|
|
167
|
-
w = $Writer.create();
|
|
168
|
-
if (m.publicKey != null && Object.hasOwnProperty.call(m, "publicKey"))
|
|
169
|
-
w.uint32(10).bytes(m.publicKey);
|
|
170
|
-
if (m.listenAddrs != null && m.listenAddrs.length) {
|
|
171
|
-
for (var i = 0; i < m.listenAddrs.length; ++i)
|
|
172
|
-
w.uint32(18).bytes(m.listenAddrs[i]);
|
|
173
|
-
}
|
|
174
|
-
if (m.protocols != null && m.protocols.length) {
|
|
175
|
-
for (var i = 0; i < m.protocols.length; ++i)
|
|
176
|
-
w.uint32(26).string(m.protocols[i]);
|
|
177
|
-
}
|
|
178
|
-
if (m.observedAddr != null && Object.hasOwnProperty.call(m, "observedAddr"))
|
|
179
|
-
w.uint32(34).bytes(m.observedAddr);
|
|
180
|
-
if (m.protocolVersion != null && Object.hasOwnProperty.call(m, "protocolVersion"))
|
|
181
|
-
w.uint32(42).string(m.protocolVersion);
|
|
182
|
-
if (m.agentVersion != null && Object.hasOwnProperty.call(m, "agentVersion"))
|
|
183
|
-
w.uint32(50).string(m.agentVersion);
|
|
184
|
-
if (m.signedPeerRecord != null && Object.hasOwnProperty.call(m, "signedPeerRecord"))
|
|
185
|
-
w.uint32(66).bytes(m.signedPeerRecord);
|
|
186
|
-
return w;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Decodes an Identify message from the specified reader or buffer.
|
|
191
|
-
* @function decode
|
|
192
|
-
* @memberof Identify
|
|
193
|
-
* @static
|
|
194
|
-
* @param {$protobuf.Reader|Uint8Array} r Reader or buffer to decode from
|
|
195
|
-
* @param {number} [l] Message length if known beforehand
|
|
196
|
-
* @returns {Identify} Identify
|
|
197
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
198
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
199
|
-
*/
|
|
200
|
-
Identify.decode = function decode(r, l) {
|
|
201
|
-
if (!(r instanceof $Reader))
|
|
202
|
-
r = $Reader.create(r);
|
|
203
|
-
var c = l === undefined ? r.len : r.pos + l, m = new $root.Identify();
|
|
204
|
-
while (r.pos < c) {
|
|
205
|
-
var t = r.uint32();
|
|
206
|
-
switch (t >>> 3) {
|
|
207
|
-
case 5:
|
|
208
|
-
m.protocolVersion = r.string();
|
|
209
|
-
break;
|
|
210
|
-
case 6:
|
|
211
|
-
m.agentVersion = r.string();
|
|
212
|
-
break;
|
|
213
|
-
case 1:
|
|
214
|
-
m.publicKey = r.bytes();
|
|
215
|
-
break;
|
|
216
|
-
case 2:
|
|
217
|
-
if (!(m.listenAddrs && m.listenAddrs.length))
|
|
218
|
-
m.listenAddrs = [];
|
|
219
|
-
m.listenAddrs.push(r.bytes());
|
|
220
|
-
break;
|
|
221
|
-
case 4:
|
|
222
|
-
m.observedAddr = r.bytes();
|
|
223
|
-
break;
|
|
224
|
-
case 3:
|
|
225
|
-
if (!(m.protocols && m.protocols.length))
|
|
226
|
-
m.protocols = [];
|
|
227
|
-
m.protocols.push(r.string());
|
|
228
|
-
break;
|
|
229
|
-
case 8:
|
|
230
|
-
m.signedPeerRecord = r.bytes();
|
|
231
|
-
break;
|
|
232
|
-
default:
|
|
233
|
-
r.skipType(t & 7);
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return m;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Creates an Identify message from a plain object. Also converts values to their respective internal types.
|
|
242
|
-
* @function fromObject
|
|
243
|
-
* @memberof Identify
|
|
244
|
-
* @static
|
|
245
|
-
* @param {Object.<string,*>} d Plain object
|
|
246
|
-
* @returns {Identify} Identify
|
|
247
|
-
*/
|
|
248
|
-
Identify.fromObject = function fromObject(d) {
|
|
249
|
-
if (d instanceof $root.Identify)
|
|
250
|
-
return d;
|
|
251
|
-
var m = new $root.Identify();
|
|
252
|
-
if (d.protocolVersion != null) {
|
|
253
|
-
m.protocolVersion = String(d.protocolVersion);
|
|
254
|
-
}
|
|
255
|
-
if (d.agentVersion != null) {
|
|
256
|
-
m.agentVersion = String(d.agentVersion);
|
|
257
|
-
}
|
|
258
|
-
if (d.publicKey != null) {
|
|
259
|
-
if (typeof d.publicKey === "string")
|
|
260
|
-
$util.base64.decode(d.publicKey, m.publicKey = $util.newBuffer($util.base64.length(d.publicKey)), 0);
|
|
261
|
-
else if (d.publicKey.length)
|
|
262
|
-
m.publicKey = d.publicKey;
|
|
263
|
-
}
|
|
264
|
-
if (d.listenAddrs) {
|
|
265
|
-
if (!Array.isArray(d.listenAddrs))
|
|
266
|
-
throw TypeError(".Identify.listenAddrs: array expected");
|
|
267
|
-
m.listenAddrs = [];
|
|
268
|
-
for (var i = 0; i < d.listenAddrs.length; ++i) {
|
|
269
|
-
if (typeof d.listenAddrs[i] === "string")
|
|
270
|
-
$util.base64.decode(d.listenAddrs[i], m.listenAddrs[i] = $util.newBuffer($util.base64.length(d.listenAddrs[i])), 0);
|
|
271
|
-
else if (d.listenAddrs[i].length)
|
|
272
|
-
m.listenAddrs[i] = d.listenAddrs[i];
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
if (d.observedAddr != null) {
|
|
276
|
-
if (typeof d.observedAddr === "string")
|
|
277
|
-
$util.base64.decode(d.observedAddr, m.observedAddr = $util.newBuffer($util.base64.length(d.observedAddr)), 0);
|
|
278
|
-
else if (d.observedAddr.length)
|
|
279
|
-
m.observedAddr = d.observedAddr;
|
|
280
|
-
}
|
|
281
|
-
if (d.protocols) {
|
|
282
|
-
if (!Array.isArray(d.protocols))
|
|
283
|
-
throw TypeError(".Identify.protocols: array expected");
|
|
284
|
-
m.protocols = [];
|
|
285
|
-
for (var i = 0; i < d.protocols.length; ++i) {
|
|
286
|
-
m.protocols[i] = String(d.protocols[i]);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
if (d.signedPeerRecord != null) {
|
|
290
|
-
if (typeof d.signedPeerRecord === "string")
|
|
291
|
-
$util.base64.decode(d.signedPeerRecord, m.signedPeerRecord = $util.newBuffer($util.base64.length(d.signedPeerRecord)), 0);
|
|
292
|
-
else if (d.signedPeerRecord.length)
|
|
293
|
-
m.signedPeerRecord = d.signedPeerRecord;
|
|
294
|
-
}
|
|
295
|
-
return m;
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Creates a plain object from an Identify message. Also converts values to other types if specified.
|
|
300
|
-
* @function toObject
|
|
301
|
-
* @memberof Identify
|
|
302
|
-
* @static
|
|
303
|
-
* @param {Identify} m Identify
|
|
304
|
-
* @param {$protobuf.IConversionOptions} [o] Conversion options
|
|
305
|
-
* @returns {Object.<string,*>} Plain object
|
|
306
|
-
*/
|
|
307
|
-
Identify.toObject = function toObject(m, o) {
|
|
308
|
-
if (!o)
|
|
309
|
-
o = {};
|
|
310
|
-
var d = {};
|
|
311
|
-
if (o.arrays || o.defaults) {
|
|
312
|
-
d.listenAddrs = [];
|
|
313
|
-
d.protocols = [];
|
|
314
|
-
}
|
|
315
|
-
if (m.publicKey != null && m.hasOwnProperty("publicKey")) {
|
|
316
|
-
d.publicKey = o.bytes === String ? $util.base64.encode(m.publicKey, 0, m.publicKey.length) : o.bytes === Array ? Array.prototype.slice.call(m.publicKey) : m.publicKey;
|
|
317
|
-
if (o.oneofs)
|
|
318
|
-
d._publicKey = "publicKey";
|
|
319
|
-
}
|
|
320
|
-
if (m.listenAddrs && m.listenAddrs.length) {
|
|
321
|
-
d.listenAddrs = [];
|
|
322
|
-
for (var j = 0; j < m.listenAddrs.length; ++j) {
|
|
323
|
-
d.listenAddrs[j] = o.bytes === String ? $util.base64.encode(m.listenAddrs[j], 0, m.listenAddrs[j].length) : o.bytes === Array ? Array.prototype.slice.call(m.listenAddrs[j]) : m.listenAddrs[j];
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if (m.protocols && m.protocols.length) {
|
|
327
|
-
d.protocols = [];
|
|
328
|
-
for (var j = 0; j < m.protocols.length; ++j) {
|
|
329
|
-
d.protocols[j] = m.protocols[j];
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
if (m.observedAddr != null && m.hasOwnProperty("observedAddr")) {
|
|
333
|
-
d.observedAddr = o.bytes === String ? $util.base64.encode(m.observedAddr, 0, m.observedAddr.length) : o.bytes === Array ? Array.prototype.slice.call(m.observedAddr) : m.observedAddr;
|
|
334
|
-
if (o.oneofs)
|
|
335
|
-
d._observedAddr = "observedAddr";
|
|
336
|
-
}
|
|
337
|
-
if (m.protocolVersion != null && m.hasOwnProperty("protocolVersion")) {
|
|
338
|
-
d.protocolVersion = m.protocolVersion;
|
|
339
|
-
if (o.oneofs)
|
|
340
|
-
d._protocolVersion = "protocolVersion";
|
|
341
|
-
}
|
|
342
|
-
if (m.agentVersion != null && m.hasOwnProperty("agentVersion")) {
|
|
343
|
-
d.agentVersion = m.agentVersion;
|
|
344
|
-
if (o.oneofs)
|
|
345
|
-
d._agentVersion = "agentVersion";
|
|
346
|
-
}
|
|
347
|
-
if (m.signedPeerRecord != null && m.hasOwnProperty("signedPeerRecord")) {
|
|
348
|
-
d.signedPeerRecord = o.bytes === String ? $util.base64.encode(m.signedPeerRecord, 0, m.signedPeerRecord.length) : o.bytes === Array ? Array.prototype.slice.call(m.signedPeerRecord) : m.signedPeerRecord;
|
|
349
|
-
if (o.oneofs)
|
|
350
|
-
d._signedPeerRecord = "signedPeerRecord";
|
|
351
|
-
}
|
|
352
|
-
return d;
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Converts this Identify to JSON.
|
|
357
|
-
* @function toJSON
|
|
358
|
-
* @memberof Identify
|
|
359
|
-
* @instance
|
|
360
|
-
* @returns {Object.<string,*>} JSON object
|
|
361
|
-
*/
|
|
362
|
-
Identify.prototype.toJSON = function toJSON() {
|
|
363
|
-
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
return Identify;
|
|
367
|
-
})();
|
|
368
|
-
|
|
369
|
-
export { $root as default };
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import * as $protobuf from "protobufjs";
|
|
2
|
-
/** Properties of an Exchange. */
|
|
3
|
-
export interface IExchange {
|
|
4
|
-
|
|
5
|
-
/** Exchange id */
|
|
6
|
-
id?: (Uint8Array|null);
|
|
7
|
-
|
|
8
|
-
/** Exchange pubkey */
|
|
9
|
-
pubkey?: (IPublicKey|null);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/** Represents an Exchange. */
|
|
13
|
-
export class Exchange implements IExchange {
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Constructs a new Exchange.
|
|
17
|
-
* @param [p] Properties to set
|
|
18
|
-
*/
|
|
19
|
-
constructor(p?: IExchange);
|
|
20
|
-
|
|
21
|
-
/** Exchange id. */
|
|
22
|
-
public id?: (Uint8Array|null);
|
|
23
|
-
|
|
24
|
-
/** Exchange pubkey. */
|
|
25
|
-
public pubkey?: (IPublicKey|null);
|
|
26
|
-
|
|
27
|
-
/** Exchange _id. */
|
|
28
|
-
public _id?: "id";
|
|
29
|
-
|
|
30
|
-
/** Exchange _pubkey. */
|
|
31
|
-
public _pubkey?: "pubkey";
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Encodes the specified Exchange message. Does not implicitly {@link Exchange.verify|verify} messages.
|
|
35
|
-
* @param m Exchange message or plain object to encode
|
|
36
|
-
* @param [w] Writer to encode to
|
|
37
|
-
* @returns Writer
|
|
38
|
-
*/
|
|
39
|
-
public static encode(m: IExchange, w?: $protobuf.Writer): $protobuf.Writer;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Decodes an Exchange message from the specified reader or buffer.
|
|
43
|
-
* @param r Reader or buffer to decode from
|
|
44
|
-
* @param [l] Message length if known beforehand
|
|
45
|
-
* @returns Exchange
|
|
46
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
47
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
48
|
-
*/
|
|
49
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): Exchange;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Creates an Exchange message from a plain object. Also converts values to their respective internal types.
|
|
53
|
-
* @param d Plain object
|
|
54
|
-
* @returns Exchange
|
|
55
|
-
*/
|
|
56
|
-
public static fromObject(d: { [k: string]: any }): Exchange;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Creates a plain object from an Exchange message. Also converts values to other types if specified.
|
|
60
|
-
* @param m Exchange
|
|
61
|
-
* @param [o] Conversion options
|
|
62
|
-
* @returns Plain object
|
|
63
|
-
*/
|
|
64
|
-
public static toObject(m: Exchange, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Converts this Exchange to JSON.
|
|
68
|
-
* @returns JSON object
|
|
69
|
-
*/
|
|
70
|
-
public toJSON(): { [k: string]: any };
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** KeyType enum. */
|
|
74
|
-
export enum KeyType {
|
|
75
|
-
RSA = 0,
|
|
76
|
-
Ed25519 = 1,
|
|
77
|
-
Secp256k1 = 2,
|
|
78
|
-
ECDSA = 3
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Represents a PublicKey. */
|
|
82
|
-
export class PublicKey implements IPublicKey {
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Constructs a new PublicKey.
|
|
86
|
-
* @param [p] Properties to set
|
|
87
|
-
*/
|
|
88
|
-
constructor(p?: IPublicKey);
|
|
89
|
-
|
|
90
|
-
/** PublicKey Type. */
|
|
91
|
-
public Type: KeyType;
|
|
92
|
-
|
|
93
|
-
/** PublicKey Data. */
|
|
94
|
-
public Data: Uint8Array;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Encodes the specified PublicKey message. Does not implicitly {@link PublicKey.verify|verify} messages.
|
|
98
|
-
* @param m PublicKey message or plain object to encode
|
|
99
|
-
* @param [w] Writer to encode to
|
|
100
|
-
* @returns Writer
|
|
101
|
-
*/
|
|
102
|
-
public static encode(m: IPublicKey, w?: $protobuf.Writer): $protobuf.Writer;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Decodes a PublicKey message from the specified reader or buffer.
|
|
106
|
-
* @param r Reader or buffer to decode from
|
|
107
|
-
* @param [l] Message length if known beforehand
|
|
108
|
-
* @returns PublicKey
|
|
109
|
-
* @throws {Error} If the payload is not a reader or valid buffer
|
|
110
|
-
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
111
|
-
*/
|
|
112
|
-
public static decode(r: ($protobuf.Reader|Uint8Array), l?: number): PublicKey;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Creates a PublicKey message from a plain object. Also converts values to their respective internal types.
|
|
116
|
-
* @param d Plain object
|
|
117
|
-
* @returns PublicKey
|
|
118
|
-
*/
|
|
119
|
-
public static fromObject(d: { [k: string]: any }): PublicKey;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Creates a plain object from a PublicKey message. Also converts values to other types if specified.
|
|
123
|
-
* @param m PublicKey
|
|
124
|
-
* @param [o] Conversion options
|
|
125
|
-
* @returns Plain object
|
|
126
|
-
*/
|
|
127
|
-
public static toObject(m: PublicKey, o?: $protobuf.IConversionOptions): { [k: string]: any };
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Converts this PublicKey to JSON.
|
|
131
|
-
* @returns JSON object
|
|
132
|
-
*/
|
|
133
|
-
public toJSON(): { [k: string]: any };
|
|
134
|
-
}
|