@leofcoin/peernet 1.0.2 → 1.0.3
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/.esdoc.json +10 -10
- package/.eslintrc.json +24 -24
- package/.travis.yml +27 -25
- package/LICENSE +21 -21
- package/README.md +64 -64
- package/deploy.js +8 -8
- package/exports/browser/browser-10ffabe1.js +56 -0
- package/exports/browser/{browser-2f0b2829.js → browser-e1cd4e67.js} +46 -38
- package/exports/browser/{client-95423644.js → client-471408b6.js} +3 -3
- package/exports/browser/dht/dht.d.ts +30 -30
- package/exports/browser/discovery/peer-discovery.d.ts +7 -7
- package/exports/browser/errors/errors.d.ts +3 -3
- package/exports/browser/handlers/data.d.ts +2 -2
- package/exports/browser/handlers/message.d.ts +30 -30
- package/exports/browser/index-601960df.js +58 -0
- package/exports/browser/messages/chat.d.ts +6 -6
- package/exports/browser/messages/data-response.d.ts +6 -6
- package/exports/browser/messages/data.d.ts +10 -10
- package/exports/browser/messages/dht-response.d.ts +6 -6
- package/exports/browser/messages/dht.d.ts +14 -14
- package/exports/browser/messages/file-link.d.ts +10 -10
- package/exports/browser/messages/file.d.ts +10 -10
- package/exports/browser/messages/peer-response.d.ts +6 -6
- package/exports/browser/messages/peer.d.ts +6 -6
- package/exports/browser/messages/peernet.d.ts +6 -6
- package/exports/browser/messages/ps.d.ts +6 -6
- package/exports/browser/messages/request.d.ts +6 -6
- package/exports/browser/messages/response.d.ts +6 -6
- package/exports/browser/{messages-2214fcbb.js → messages-cf68bfb3.js} +153 -153
- package/exports/browser/messages.d.ts +12 -12
- package/exports/browser/peer-info.d.ts +4 -4
- package/exports/browser/{peernet-e74b2091.js → peernet-e1e0a046.js} +13021 -9963
- package/exports/browser/peernet.js +1 -1
- package/exports/browser/prompts/password/browser.d.ts +2 -2
- package/exports/browser/prompts/password/node.d.ts +2 -2
- package/exports/browser/proto/chat-message.proto.d.ts +7 -7
- package/exports/browser/proto/data-response.proto.d.ts +5 -5
- package/exports/browser/proto/data.proto.d.ts +5 -5
- package/exports/browser/proto/dht-response.proto.d.ts +5 -5
- package/exports/browser/proto/dht.proto.d.ts +5 -5
- package/exports/browser/proto/file-link.proto.d.ts +6 -6
- package/exports/browser/proto/file.proto.d.ts +6 -6
- package/exports/browser/proto/peer-response.proto.d.ts +4 -4
- package/exports/browser/proto/peer.proto.d.ts +4 -4
- package/exports/browser/proto/peernet.proto.d.ts +8 -8
- package/exports/browser/proto/ps.proto.d.ts +5 -5
- package/exports/browser/proto/request.proto.d.ts +4 -4
- package/exports/browser/proto/response.proto.d.ts +4 -4
- package/exports/browser/qr-scanner-worker.min-c002e984.js +100 -0
- package/exports/browser/utils/utils.d.ts +7 -7
- package/exports/dht/dht.d.ts +30 -30
- package/exports/discovery/peer-discovery.d.ts +7 -7
- package/exports/errors/errors.d.ts +3 -3
- package/exports/handlers/data.d.ts +2 -2
- package/exports/handlers/message.d.ts +30 -30
- package/exports/messages/chat.d.ts +6 -6
- package/exports/messages/data-response.d.ts +6 -6
- package/exports/messages/data.d.ts +10 -10
- package/exports/messages/dht-response.d.ts +6 -6
- package/exports/messages/dht.d.ts +14 -14
- package/exports/messages/file-link.d.ts +10 -10
- package/exports/messages/file.d.ts +10 -10
- package/exports/messages/peer-response.d.ts +6 -6
- package/exports/messages/peer.d.ts +6 -6
- package/exports/messages/peernet.d.ts +6 -6
- package/exports/messages/ps.d.ts +6 -6
- package/exports/messages/request.d.ts +6 -6
- package/exports/messages/response.d.ts +6 -6
- package/exports/{messages-75fe56a4.js → messages-65501ef9.js} +152 -152
- package/exports/messages.d.ts +12 -12
- package/exports/peer-info.d.ts +4 -4
- package/exports/peernet.js +969 -968
- package/exports/prompts/password/browser.d.ts +2 -2
- package/exports/prompts/password/node.d.ts +2 -2
- package/exports/proto/chat-message.proto.d.ts +7 -7
- package/exports/proto/data-response.proto.d.ts +5 -5
- package/exports/proto/data.proto.d.ts +5 -5
- package/exports/proto/dht-response.proto.d.ts +5 -5
- package/exports/proto/dht.proto.d.ts +5 -5
- package/exports/proto/file-link.proto.d.ts +6 -6
- package/exports/proto/file.proto.d.ts +6 -6
- package/exports/proto/peer-response.proto.d.ts +4 -4
- package/exports/proto/peer.proto.d.ts +4 -4
- package/exports/proto/peernet.proto.d.ts +8 -8
- package/exports/proto/ps.proto.d.ts +5 -5
- package/exports/proto/request.proto.d.ts +4 -4
- package/exports/proto/response.proto.d.ts +4 -4
- package/exports/src/prompts/password.js +3 -3
- package/exports/utils/utils.d.ts +7 -7
- package/index.html +19 -19
- package/package.json +59 -55
- package/rollup.config.js +53 -53
- package/src/dht/dht.js +119 -119
- package/src/discovery/peer-discovery.js +75 -75
- package/src/handlers/data.js +12 -12
- package/src/handlers/message.js +34 -34
- package/src/identity.ts +81 -80
- package/src/messages/chat.js +14 -14
- package/src/messages/data-response.js +14 -14
- package/src/messages/data.js +18 -18
- package/src/messages/dht-response.js +14 -14
- package/src/messages/dht.js +22 -22
- package/src/messages/file-link.js +18 -18
- package/src/messages/file.js +18 -18
- package/src/messages/peer-response.js +14 -14
- package/src/messages/peer.js +13 -13
- package/src/messages/peernet.js +14 -14
- package/src/messages/ps.js +13 -13
- package/src/messages/request.js +14 -14
- package/src/messages/response.js +14 -14
- package/src/messages.js +13 -13
- package/src/peer-info.js +9 -9
- package/src/peernet.ts +699 -699
- package/src/prompts/password/node.js +5 -5
- package/src/proto/chat-message.proto.js +6 -6
- package/src/utils/utils.js +78 -78
- package/test/client.js +6 -6
- package/test/codec.js +56 -56
- package/test/hash.js +13 -13
- package/test/index.js +3 -3
- package/test/lastBlock.js +7 -7
- package/test/messages.js +26 -26
- package/test/peernet.js +17 -17
- package/test.js +47 -47
- package/test2.js +9 -9
- package/test3.js +15 -15
- package/test4.js +7 -7
- package/tsconfig.json +12 -12
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/codec-format-interface.js.html +0 -637
- package/coverage/lcov-report/dht-response.js.html +0 -193
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -199
- package/exports/browser/browser-3c1d0477.js +0 -73
- package/exports/browser/index-3699fac4.js +0 -34
package/coverage/lcov.info
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
TN:
|
|
2
|
-
SF:dist\commonjs\codec-format-interface.js
|
|
3
|
-
FN:11,_interopDefaultLegacy
|
|
4
|
-
FN:23,(anonymous_1)
|
|
5
|
-
FN:44,(anonymous_2)
|
|
6
|
-
FN:51,(anonymous_3)
|
|
7
|
-
FN:60,(anonymous_4)
|
|
8
|
-
FN:72,(anonymous_5)
|
|
9
|
-
FN:83,(anonymous_6)
|
|
10
|
-
FN:89,(anonymous_7)
|
|
11
|
-
FN:97,(anonymous_8)
|
|
12
|
-
FN:108,(anonymous_9)
|
|
13
|
-
FN:116,(anonymous_10)
|
|
14
|
-
FN:124,(anonymous_11)
|
|
15
|
-
FN:132,(anonymous_12)
|
|
16
|
-
FN:140,(anonymous_13)
|
|
17
|
-
FN:148,(anonymous_14)
|
|
18
|
-
FN:156,(anonymous_15)
|
|
19
|
-
FN:164,(anonymous_16)
|
|
20
|
-
FN:172,(anonymous_17)
|
|
21
|
-
FN:173,(anonymous_18)
|
|
22
|
-
FNF:19
|
|
23
|
-
FNH:0
|
|
24
|
-
FNDA:0,_interopDefaultLegacy
|
|
25
|
-
FNDA:0,(anonymous_1)
|
|
26
|
-
FNDA:0,(anonymous_2)
|
|
27
|
-
FNDA:0,(anonymous_3)
|
|
28
|
-
FNDA:0,(anonymous_4)
|
|
29
|
-
FNDA:0,(anonymous_5)
|
|
30
|
-
FNDA:0,(anonymous_6)
|
|
31
|
-
FNDA:0,(anonymous_7)
|
|
32
|
-
FNDA:0,(anonymous_8)
|
|
33
|
-
FNDA:0,(anonymous_9)
|
|
34
|
-
FNDA:0,(anonymous_10)
|
|
35
|
-
FNDA:0,(anonymous_11)
|
|
36
|
-
FNDA:0,(anonymous_12)
|
|
37
|
-
FNDA:0,(anonymous_13)
|
|
38
|
-
FNDA:0,(anonymous_14)
|
|
39
|
-
FNDA:0,(anonymous_15)
|
|
40
|
-
FNDA:0,(anonymous_16)
|
|
41
|
-
FNDA:0,(anonymous_17)
|
|
42
|
-
FNDA:0,(anonymous_18)
|
|
43
|
-
DA:3,1
|
|
44
|
-
DA:4,1
|
|
45
|
-
DA:5,1
|
|
46
|
-
DA:6,0
|
|
47
|
-
DA:7,0
|
|
48
|
-
DA:8,0
|
|
49
|
-
DA:9,0
|
|
50
|
-
DA:11,0
|
|
51
|
-
DA:13,0
|
|
52
|
-
DA:14,0
|
|
53
|
-
DA:15,0
|
|
54
|
-
DA:24,0
|
|
55
|
-
DA:25,0
|
|
56
|
-
DA:26,0
|
|
57
|
-
DA:27,0
|
|
58
|
-
DA:28,0
|
|
59
|
-
DA:29,0
|
|
60
|
-
DA:30,0
|
|
61
|
-
DA:31,0
|
|
62
|
-
DA:32,0
|
|
63
|
-
DA:33,0
|
|
64
|
-
DA:34,0
|
|
65
|
-
DA:35,0
|
|
66
|
-
DA:37,0
|
|
67
|
-
DA:45,0
|
|
68
|
-
DA:52,0
|
|
69
|
-
DA:53,0
|
|
70
|
-
DA:54,0
|
|
71
|
-
DA:61,0
|
|
72
|
-
DA:62,0
|
|
73
|
-
DA:63,0
|
|
74
|
-
DA:64,0
|
|
75
|
-
DA:65,0
|
|
76
|
-
DA:66,0
|
|
77
|
-
DA:73,0
|
|
78
|
-
DA:74,0
|
|
79
|
-
DA:75,0
|
|
80
|
-
DA:76,0
|
|
81
|
-
DA:77,0
|
|
82
|
-
DA:78,0
|
|
83
|
-
DA:79,0
|
|
84
|
-
DA:80,0
|
|
85
|
-
DA:84,0
|
|
86
|
-
DA:85,0
|
|
87
|
-
DA:86,0
|
|
88
|
-
DA:90,0
|
|
89
|
-
DA:91,0
|
|
90
|
-
DA:94,0
|
|
91
|
-
DA:98,0
|
|
92
|
-
DA:99,0
|
|
93
|
-
DA:102,0
|
|
94
|
-
DA:109,0
|
|
95
|
-
DA:110,0
|
|
96
|
-
DA:117,0
|
|
97
|
-
DA:118,0
|
|
98
|
-
DA:125,0
|
|
99
|
-
DA:126,0
|
|
100
|
-
DA:133,0
|
|
101
|
-
DA:134,0
|
|
102
|
-
DA:141,0
|
|
103
|
-
DA:142,0
|
|
104
|
-
DA:149,0
|
|
105
|
-
DA:150,0
|
|
106
|
-
DA:157,0
|
|
107
|
-
DA:158,0
|
|
108
|
-
DA:165,0
|
|
109
|
-
DA:166,0
|
|
110
|
-
DA:167,0
|
|
111
|
-
DA:168,0
|
|
112
|
-
DA:172,0
|
|
113
|
-
DA:173,0
|
|
114
|
-
DA:178,0
|
|
115
|
-
DA:179,0
|
|
116
|
-
DA:184,0
|
|
117
|
-
LF:74
|
|
118
|
-
LH:3
|
|
119
|
-
BRDA:11,0,0,0
|
|
120
|
-
BRDA:11,0,1,0
|
|
121
|
-
BRDA:11,1,0,0
|
|
122
|
-
BRDA:11,1,1,0
|
|
123
|
-
BRDA:11,1,2,0
|
|
124
|
-
BRDA:23,2,0,0
|
|
125
|
-
BRDA:26,3,0,0
|
|
126
|
-
BRDA:26,3,1,0
|
|
127
|
-
BRDA:27,4,0,0
|
|
128
|
-
BRDA:27,4,1,0
|
|
129
|
-
BRDA:28,5,0,0
|
|
130
|
-
BRDA:28,5,1,0
|
|
131
|
-
BRDA:29,6,0,0
|
|
132
|
-
BRDA:29,6,1,0
|
|
133
|
-
BRDA:30,7,0,0
|
|
134
|
-
BRDA:30,7,1,0
|
|
135
|
-
BRDA:31,8,0,0
|
|
136
|
-
BRDA:31,8,1,0
|
|
137
|
-
BRDA:32,9,0,0
|
|
138
|
-
BRDA:32,9,1,0
|
|
139
|
-
BRDA:33,10,0,0
|
|
140
|
-
BRDA:33,10,1,0
|
|
141
|
-
BRDA:34,11,0,0
|
|
142
|
-
BRDA:34,11,1,0
|
|
143
|
-
BRDA:73,12,0,0
|
|
144
|
-
BRDA:73,12,1,0
|
|
145
|
-
BRDA:84,13,0,0
|
|
146
|
-
BRDA:84,13,1,0
|
|
147
|
-
BRDA:86,14,0,0
|
|
148
|
-
BRDA:86,14,1,0
|
|
149
|
-
BRDA:91,15,0,0
|
|
150
|
-
BRDA:91,15,1,0
|
|
151
|
-
BRDA:99,16,0,0
|
|
152
|
-
BRDA:99,16,1,0
|
|
153
|
-
BRDA:141,17,0,0
|
|
154
|
-
BRDA:141,17,1,0
|
|
155
|
-
BRDA:149,18,0,0
|
|
156
|
-
BRDA:149,18,1,0
|
|
157
|
-
BRDA:157,19,0,0
|
|
158
|
-
BRDA:157,19,1,0
|
|
159
|
-
BRDA:166,20,0,0
|
|
160
|
-
BRDA:166,20,1,0
|
|
161
|
-
BRF:42
|
|
162
|
-
BRH:0
|
|
163
|
-
end_of_record
|
|
164
|
-
TN:
|
|
165
|
-
SF:dist\commonjs\dht-response.js
|
|
166
|
-
FN:13,_interopDefaultLegacy
|
|
167
|
-
FN:26,(anonymous_1)
|
|
168
|
-
FN:30,(anonymous_2)
|
|
169
|
-
FNF:3
|
|
170
|
-
FNH:0
|
|
171
|
-
FNDA:0,_interopDefaultLegacy
|
|
172
|
-
FNDA:0,(anonymous_1)
|
|
173
|
-
FNDA:0,(anonymous_2)
|
|
174
|
-
DA:3,1
|
|
175
|
-
DA:4,1
|
|
176
|
-
DA:5,0
|
|
177
|
-
DA:6,0
|
|
178
|
-
DA:7,0
|
|
179
|
-
DA:8,0
|
|
180
|
-
DA:9,0
|
|
181
|
-
DA:10,0
|
|
182
|
-
DA:11,0
|
|
183
|
-
DA:13,0
|
|
184
|
-
DA:15,0
|
|
185
|
-
DA:17,0
|
|
186
|
-
DA:27,0
|
|
187
|
-
DA:31,0
|
|
188
|
-
DA:32,0
|
|
189
|
-
DA:36,0
|
|
190
|
-
LF:16
|
|
191
|
-
LH:2
|
|
192
|
-
BRDA:13,0,0,0
|
|
193
|
-
BRDA:13,0,1,0
|
|
194
|
-
BRDA:13,1,0,0
|
|
195
|
-
BRDA:13,1,1,0
|
|
196
|
-
BRDA:13,1,2,0
|
|
197
|
-
BRF:5
|
|
198
|
-
BRH:0
|
|
199
|
-
end_of_record
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
function _mergeNamespaces(n, m) {
|
|
2
|
-
m.forEach(function (e) {
|
|
3
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
4
|
-
if (k !== 'default' && !(k in n)) {
|
|
5
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
6
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () { return e[k]; }
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
});
|
|
13
|
-
return Object.freeze(n);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
var MediaStream = window.MediaStream;
|
|
17
|
-
var MediaStreamTrack = window.MediaStreamTrack;
|
|
18
|
-
var RTCDataChannel = window.RTCDataChannel;
|
|
19
|
-
var RTCDataChannelEvent = window.RTCDataChannelEvent;
|
|
20
|
-
var RTCDtlsTransport = window.RTCDtlsTransport;
|
|
21
|
-
var RTCIceCandidate = window.RTCIceCandidate;
|
|
22
|
-
var RTCIceTransport = window.RTCIceTransport;
|
|
23
|
-
var RTCPeerConnection = window.RTCPeerConnection;
|
|
24
|
-
var RTCPeerConnectionIceEvent = window.RTCPeerConnectionIceEvent;
|
|
25
|
-
var RTCRtpReceiver = window.RTCRtpReceiver;
|
|
26
|
-
var RTCRtpSender = window.RTCRtpSender;
|
|
27
|
-
var RTCRtpTransceiver = window.RTCRtpTransceiver;
|
|
28
|
-
var RTCSctpTransport = window.RTCSctpTransport;
|
|
29
|
-
var RTCSessionDescription = window.RTCSessionDescription;
|
|
30
|
-
var getUserMedia = window.getUserMedia;
|
|
31
|
-
var mediaDevices = navigator.mediaDevices;
|
|
32
|
-
|
|
33
|
-
var browser = {
|
|
34
|
-
MediaStream: MediaStream,
|
|
35
|
-
MediaStreamTrack: MediaStreamTrack,
|
|
36
|
-
RTCDataChannel: RTCDataChannel,
|
|
37
|
-
RTCDataChannelEvent: RTCDataChannelEvent,
|
|
38
|
-
RTCDtlsTransport: RTCDtlsTransport,
|
|
39
|
-
RTCIceCandidate: RTCIceCandidate,
|
|
40
|
-
RTCIceTransport: RTCIceTransport,
|
|
41
|
-
RTCPeerConnection: RTCPeerConnection,
|
|
42
|
-
RTCPeerConnectionIceEvent: RTCPeerConnectionIceEvent,
|
|
43
|
-
RTCRtpReceiver: RTCRtpReceiver,
|
|
44
|
-
RTCRtpSender: RTCRtpSender,
|
|
45
|
-
RTCRtpTransceiver: RTCRtpTransceiver,
|
|
46
|
-
RTCSctpTransport: RTCSctpTransport,
|
|
47
|
-
RTCSessionDescription: RTCSessionDescription,
|
|
48
|
-
getUserMedia: getUserMedia,
|
|
49
|
-
mediaDevices: mediaDevices
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var browser$1 = /*#__PURE__*/_mergeNamespaces({
|
|
53
|
-
__proto__: null,
|
|
54
|
-
MediaStream: MediaStream,
|
|
55
|
-
MediaStreamTrack: MediaStreamTrack,
|
|
56
|
-
RTCDataChannel: RTCDataChannel,
|
|
57
|
-
RTCDataChannelEvent: RTCDataChannelEvent,
|
|
58
|
-
RTCDtlsTransport: RTCDtlsTransport,
|
|
59
|
-
RTCIceCandidate: RTCIceCandidate,
|
|
60
|
-
RTCIceTransport: RTCIceTransport,
|
|
61
|
-
RTCPeerConnection: RTCPeerConnection,
|
|
62
|
-
RTCPeerConnectionIceEvent: RTCPeerConnectionIceEvent,
|
|
63
|
-
RTCRtpReceiver: RTCRtpReceiver,
|
|
64
|
-
RTCRtpSender: RTCRtpSender,
|
|
65
|
-
RTCRtpTransceiver: RTCRtpTransceiver,
|
|
66
|
-
RTCSctpTransport: RTCSctpTransport,
|
|
67
|
-
RTCSessionDescription: RTCSessionDescription,
|
|
68
|
-
default: browser,
|
|
69
|
-
getUserMedia: getUserMedia,
|
|
70
|
-
mediaDevices: mediaDevices
|
|
71
|
-
}, [browser]);
|
|
72
|
-
|
|
73
|
-
export { browser$1 as b };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { M as MultiWallet } from './peernet-e74b2091.js';
|
|
2
|
-
import './value-157ab062.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @params {String} network
|
|
6
|
-
* @return {object} { identity, accounts, config }
|
|
7
|
-
*/
|
|
8
|
-
var index = async (password, network) => {
|
|
9
|
-
if (!password)
|
|
10
|
-
throw new Error('wallets need to be password protected.');
|
|
11
|
-
let wallet = new MultiWallet(network);
|
|
12
|
-
/**
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
const mnemonic = await wallet.generate(password);
|
|
16
|
-
wallet = new MultiWallet(network);
|
|
17
|
-
await wallet.recover(mnemonic, password, network);
|
|
18
|
-
/**
|
|
19
|
-
* @type {object}
|
|
20
|
-
*/
|
|
21
|
-
const external = await wallet.account(1).external(1);
|
|
22
|
-
const externalAddress = await external.address;
|
|
23
|
-
const internal = await wallet.account(1).internal(1);
|
|
24
|
-
const internalAddress = await internal.address;
|
|
25
|
-
return {
|
|
26
|
-
identity: {
|
|
27
|
-
mnemonic,
|
|
28
|
-
walletId: await external.id
|
|
29
|
-
},
|
|
30
|
-
accounts: [['main account', externalAddress, internalAddress]]
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { index as default };
|