@leofcoin/peernet 1.1.80 → 1.1.82
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/.gitattributes +2 -2
- package/.prettierrc +7 -7
- package/.travis.yml +27 -27
- package/BREAKING_CHANGES.md +34 -34
- package/LICENSE +21 -21
- package/README.md +72 -72
- package/deploy.js +8 -8
- package/exports/browser/{client-Depp28gl.js → client-C0VVXIWm.js} +2 -2
- package/exports/browser/{index-DqPlTtAJ.js → index-CEwkDK9g.js} +5 -496
- package/exports/browser/{messages-RYLqPGkg.js → messages-BdevLRCA.js} +164 -164
- package/exports/browser/{peernet-B7TZP-Wg.js → peernet-DEIKLS2i.js} +185 -185
- package/exports/browser/peernet.js +1 -1
- package/exports/{messages-CRhtDipD.js → messages-BmpgEM4y.js} +163 -163
- package/exports/peernet.js +184 -184
- package/exports/src/prompts/password.js +3 -3
- package/index.html +19 -19
- package/package.json +71 -71
- package/rollup.config.js +63 -63
- package/src/dht/dht.ts +147 -147
- package/src/discovery/peer-discovery.js +75 -75
- package/src/errors/errors.js +12 -12
- package/src/handlers/data.js +15 -15
- package/src/handlers/message.js +34 -34
- package/src/identity.ts +104 -104
- package/src/messages/chat.js +13 -13
- package/src/messages/data-response.js +13 -13
- package/src/messages/data.js +17 -17
- package/src/messages/dht-response.js +13 -13
- package/src/messages/dht.js +21 -21
- package/src/messages/file-link.js +17 -17
- package/src/messages/file.js +17 -17
- package/src/messages/peer-response.js +13 -13
- package/src/messages/peer.js +13 -13
- package/src/messages/peernet.js +13 -13
- package/src/messages/ps.js +13 -13
- package/src/messages/request.js +13 -13
- package/src/messages/response.js +13 -13
- package/src/messages.js +13 -13
- package/src/peer-info.js +9 -9
- package/src/peernet.ts +817 -817
- package/src/prompts/password/browser.js +1 -1
- package/src/prompts/password/node.js +6 -6
- package/src/proto/chat-message.proto.js +6 -6
- package/src/proto/data-response.proto.js +4 -4
- package/src/proto/data.proto.js +4 -4
- package/src/proto/dht-response.proto.js +4 -4
- package/src/proto/dht.proto.js +4 -4
- package/src/proto/file-link.proto.js +5 -5
- package/src/proto/file.proto.js +5 -5
- package/src/proto/peer-response.proto.js +3 -3
- package/src/proto/peer.proto.js +3 -3
- package/src/proto/peernet.proto.js +7 -7
- package/src/proto/ps.proto.js +4 -4
- package/src/proto/request.proto.js +4 -4
- package/src/proto/response.proto.js +3 -3
- package/src/types.ts +25 -25
- package/src/utils/utils.js +77 -77
- package/test/client.js +14 -14
- 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/peernet.test.js +159 -159
- package/test.js +62 -62
- package/test2.js +13 -13
- package/test3.js +15 -15
- package/test4.js +7 -7
- package/tsconfig.json +11 -11
package/exports/peernet.js
CHANGED
|
@@ -10,140 +10,140 @@ import '@leofcoin/identity-utils';
|
|
|
10
10
|
import 'qr-scanner';
|
|
11
11
|
import 'qrcode';
|
|
12
12
|
|
|
13
|
-
const BufferToUint8Array = (data) => {
|
|
14
|
-
if (data.type === 'Buffer') {
|
|
15
|
-
data = new Uint8Array(data.data);
|
|
16
|
-
}
|
|
17
|
-
return data
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const protoFor = (message) => {
|
|
21
|
-
const codec = new Codec(message);
|
|
22
|
-
if (!codec.name) throw new Error(`proto not found ${message}`)
|
|
23
|
-
const Proto = globalThis.peernet.protos[codec.name];
|
|
24
|
-
if (!Proto) throw new Error(`No proto defined for ${codec.name}`)
|
|
25
|
-
return new Proto(message)
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* wether or not a peernet daemon is active
|
|
30
|
-
* @return {Boolean}
|
|
31
|
-
*/
|
|
32
|
-
const hasDaemon = async () => {
|
|
33
|
-
try {
|
|
34
|
-
let response = await fetch('http://127.0.0.1:1000/api/version');
|
|
35
|
-
response = await response.json();
|
|
36
|
-
return Boolean(response.client === '@peernet/api/http')
|
|
37
|
-
} catch (e) {
|
|
38
|
-
return false
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const https = () => {
|
|
43
|
-
if (!globalThis.location) return false
|
|
44
|
-
return Boolean(globalThis.location.protocol === 'https:')
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get current environment
|
|
49
|
-
* @return {String} current environment [node, electron, browser]
|
|
50
|
-
*/
|
|
51
|
-
const environment = () => {
|
|
52
|
-
const _navigator = globalThis.navigator;
|
|
53
|
-
if (!_navigator) {
|
|
54
|
-
return 'node'
|
|
55
|
-
} else if (_navigator && /electron/i.test(_navigator.userAgent)) {
|
|
56
|
-
return 'electron'
|
|
57
|
-
} else {
|
|
58
|
-
return 'browser'
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* * Get current environment
|
|
64
|
-
* @return {Object} result
|
|
65
|
-
* @property {Boolean} reult.daemon whether or not daemon is running
|
|
66
|
-
* @property {Boolean} reult.environment Current environment
|
|
67
|
-
*/
|
|
68
|
-
const target = async () => {
|
|
69
|
-
let daemon = false;
|
|
70
|
-
if (!https()) daemon = await hasDaemon();
|
|
71
|
-
|
|
72
|
-
return { daemon, environment: environment() }
|
|
13
|
+
const BufferToUint8Array = (data) => {
|
|
14
|
+
if (data.type === 'Buffer') {
|
|
15
|
+
data = new Uint8Array(data.data);
|
|
16
|
+
}
|
|
17
|
+
return data
|
|
73
18
|
};
|
|
74
19
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
20
|
+
const protoFor = (message) => {
|
|
21
|
+
const codec = new Codec(message);
|
|
22
|
+
if (!codec.name) throw new Error(`proto not found ${message}`)
|
|
23
|
+
const Proto = globalThis.peernet.protos[codec.name];
|
|
24
|
+
if (!Proto) throw new Error(`No proto defined for ${codec.name}`)
|
|
25
|
+
return new Proto(message)
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* wether or not a peernet daemon is active
|
|
30
|
+
* @return {Boolean}
|
|
31
|
+
*/
|
|
32
|
+
const hasDaemon = async () => {
|
|
33
|
+
try {
|
|
34
|
+
let response = await fetch('http://127.0.0.1:1000/api/version');
|
|
35
|
+
response = await response.json();
|
|
36
|
+
return Boolean(response.client === '@peernet/api/http')
|
|
37
|
+
} catch (e) {
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const https = () => {
|
|
43
|
+
if (!globalThis.location) return false
|
|
44
|
+
return Boolean(globalThis.location.protocol === 'https:')
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get current environment
|
|
49
|
+
* @return {String} current environment [node, electron, browser]
|
|
50
|
+
*/
|
|
51
|
+
const environment = () => {
|
|
52
|
+
const _navigator = globalThis.navigator;
|
|
53
|
+
if (!_navigator) {
|
|
54
|
+
return 'node'
|
|
55
|
+
} else if (_navigator && /electron/i.test(_navigator.userAgent)) {
|
|
56
|
+
return 'electron'
|
|
57
|
+
} else {
|
|
58
|
+
return 'browser'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* * Get current environment
|
|
64
|
+
* @return {Object} result
|
|
65
|
+
* @property {Boolean} reult.daemon whether or not daemon is running
|
|
66
|
+
* @property {Boolean} reult.environment Current environment
|
|
67
|
+
*/
|
|
68
|
+
const target = async () => {
|
|
69
|
+
let daemon = false;
|
|
70
|
+
if (!https()) daemon = await hasDaemon();
|
|
71
|
+
|
|
72
|
+
return { daemon, environment: environment() }
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
class PeerDiscovery {
|
|
76
|
+
constructor(id) {
|
|
77
|
+
this.id = id;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
_getPeerId(id) {
|
|
81
|
+
if (!peernet.peerMap || (peernet.peerMap && peernet.peerMap.size === 0)) return false
|
|
82
|
+
|
|
83
|
+
for (const entry of [...peernet.peerMap.entries()]) {
|
|
84
|
+
for (const _id of entry[1]) {
|
|
85
|
+
if (_id === id) return entry[0]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async discover(peer) {
|
|
91
|
+
let id = this._getPeerId(peer.id);
|
|
92
|
+
if (id) return id
|
|
93
|
+
const data = await new peernet.protos['peernet-peer']({ id: this.id });
|
|
94
|
+
const node = await peernet.prepareMessage(peer.id, data.encoded);
|
|
95
|
+
|
|
96
|
+
let response = await peer.request(node.encoded);
|
|
97
|
+
response = await protoFor(response);
|
|
98
|
+
response = await new peernet.protos['peernet-peer-response'](response.decoded.data);
|
|
99
|
+
|
|
100
|
+
id = response.decoded.id;
|
|
101
|
+
if (id === this.id) return
|
|
102
|
+
|
|
103
|
+
if (!peernet.peerMap.has(id)) peernet.peerMap.set(id, [peer.id]);
|
|
104
|
+
else {
|
|
105
|
+
const connections = peernet.peerMap.get(id);
|
|
106
|
+
if (connections.indexOf(peer.id) === -1) {
|
|
107
|
+
connections.push(peer.id);
|
|
108
|
+
peernet.peerMap.set(peer.id, connections);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return id
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async discoverHandler(message, peer) {
|
|
115
|
+
const { id, proto } = message;
|
|
116
|
+
// if (typeof message.data === 'string') message.data = Buffer.from(message.data)
|
|
117
|
+
if (proto.name === 'peernet-peer') {
|
|
118
|
+
const from = proto.decoded.id;
|
|
119
|
+
if (from === this.id) return
|
|
120
|
+
|
|
121
|
+
if (!peernet.peerMap.has(from)) peernet.peerMap.set(from, [peer.id]);
|
|
122
|
+
else {
|
|
123
|
+
const connections = peernet.peerMap.get(from);
|
|
124
|
+
if (connections.indexOf(peer.id) === -1) {
|
|
125
|
+
connections.push(peer.id);
|
|
126
|
+
peernet.peerMap.set(from, connections);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const data = await new peernet.protos['peernet-peer-response']({ id: this.id });
|
|
130
|
+
const node = await peernet.prepareMessage(from, data.encoded);
|
|
131
|
+
|
|
132
|
+
peer.write(Buffer.from(JSON.stringify({ id, data: node.encoded })));
|
|
133
|
+
} else if (proto.name === 'peernet-peer-response') {
|
|
134
|
+
const from = proto.decoded.id;
|
|
135
|
+
if (from === this.id) return
|
|
136
|
+
|
|
137
|
+
if (!peernet.peerMap.has(from)) peernet.peerMap.set(from, [peer.id]);
|
|
138
|
+
else {
|
|
139
|
+
const connections = peernet.peerMap.get(from);
|
|
140
|
+
if (connections.indexOf(peer.id) === -1) {
|
|
141
|
+
connections.push(peer.id);
|
|
142
|
+
peernet.peerMap.set(from, connections);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
/**
|
|
@@ -255,60 +255,60 @@ class DhtEarth {
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
class MessageHandler {
|
|
259
|
-
constructor(network) {
|
|
260
|
-
this.network = network;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* hash and sign message
|
|
264
|
-
*
|
|
265
|
-
* @param {object} message
|
|
266
|
-
* @param {Buffer} message.from peer id
|
|
267
|
-
* @param {Buffer} message.to peer id
|
|
268
|
-
* @param {string} message.data Peernet message
|
|
269
|
-
* (PeernetMessage excluded) encoded as a string
|
|
270
|
-
* @return message
|
|
271
|
-
*/
|
|
272
|
-
async hashAndSignMessage(message) {
|
|
273
|
-
const hash = await message.peernetHash;
|
|
274
|
-
message.decoded.signature = globalThis.identity.sign(hash.buffer);
|
|
275
|
-
return message
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* @param {String} from - peer id
|
|
280
|
-
* @param {String} to - peer id
|
|
281
|
-
* @param {String|PeernetMessage} data - data encoded message string
|
|
282
|
-
* or the messageNode itself
|
|
283
|
-
*/
|
|
284
|
-
async prepareMessage(message) {
|
|
285
|
-
if (message.keys.includes('signature')) {
|
|
286
|
-
message = await this.hashAndSignMessage(message);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return message
|
|
290
|
-
}
|
|
258
|
+
class MessageHandler {
|
|
259
|
+
constructor(network) {
|
|
260
|
+
this.network = network;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* hash and sign message
|
|
264
|
+
*
|
|
265
|
+
* @param {object} message
|
|
266
|
+
* @param {Buffer} message.from peer id
|
|
267
|
+
* @param {Buffer} message.to peer id
|
|
268
|
+
* @param {string} message.data Peernet message
|
|
269
|
+
* (PeernetMessage excluded) encoded as a string
|
|
270
|
+
* @return message
|
|
271
|
+
*/
|
|
272
|
+
async hashAndSignMessage(message) {
|
|
273
|
+
const hash = await message.peernetHash;
|
|
274
|
+
message.decoded.signature = globalThis.identity.sign(hash.buffer);
|
|
275
|
+
return message
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @param {String} from - peer id
|
|
280
|
+
* @param {String} to - peer id
|
|
281
|
+
* @param {String|PeernetMessage} data - data encoded message string
|
|
282
|
+
* or the messageNode itself
|
|
283
|
+
*/
|
|
284
|
+
async prepareMessage(message) {
|
|
285
|
+
if (message.keys.includes('signature')) {
|
|
286
|
+
message = await this.hashAndSignMessage(message);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return message
|
|
290
|
+
}
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
const dataHandler = async (message) => {
|
|
294
|
-
if (!message) return
|
|
295
|
-
|
|
296
|
-
try {
|
|
297
|
-
const { data, id, from, peer } = message;
|
|
298
|
-
const proto = await protoFor(data);
|
|
299
|
-
peernet._protoHandler({ id, proto }, peernet.connections[from] || peer, from);
|
|
300
|
-
} catch (error) {
|
|
301
|
-
console.error(error);
|
|
302
|
-
}
|
|
293
|
+
const dataHandler = async (message) => {
|
|
294
|
+
if (!message) return
|
|
295
|
+
|
|
296
|
+
try {
|
|
297
|
+
const { data, id, from, peer } = message;
|
|
298
|
+
const proto = await protoFor(data);
|
|
299
|
+
peernet._protoHandler({ id, proto }, peernet.connections[from] || peer, from);
|
|
300
|
+
} catch (error) {
|
|
301
|
+
console.error(error);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const dhtError = (proto) => {
|
|
306
|
+
const text = `Received proto ${proto.name} expected peernet-dht-response`;
|
|
307
|
+
return new Error(`Routing error: ${text}`)
|
|
303
308
|
};
|
|
304
309
|
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
return new Error(`Routing error: ${text}`)
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
const nothingFoundError = (hash) => {
|
|
311
|
-
return new Error(`nothing found for ${hash}`)
|
|
310
|
+
const nothingFoundError = (hash) => {
|
|
311
|
+
return new Error(`nothing found for ${hash}`)
|
|
312
312
|
};
|
|
313
313
|
|
|
314
314
|
globalThis.LeofcoinStorage = Storage;
|
|
@@ -433,7 +433,7 @@ class Peernet {
|
|
|
433
433
|
* @return {Array} peerId
|
|
434
434
|
*/
|
|
435
435
|
get peers() {
|
|
436
|
-
return Object.entries(this.client?.connections);
|
|
436
|
+
return Object.entries(this.client?.connections || {});
|
|
437
437
|
}
|
|
438
438
|
get connections() {
|
|
439
439
|
return this.client?.connections || {};
|
|
@@ -457,7 +457,7 @@ class Peernet {
|
|
|
457
457
|
this.root = options.root;
|
|
458
458
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
459
459
|
// FolderMessageResponse
|
|
460
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
460
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-BmpgEM4y.js');
|
|
461
461
|
/**
|
|
462
462
|
* proto Object containing protos
|
|
463
463
|
* @type {Object}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
|
|
3
|
-
var node = async () => {
|
|
4
|
-
const answers = await inquirer.prompt({ type: 'password', name: 'password', message: 'Enter password' });
|
|
5
|
-
return answers.password
|
|
3
|
+
var node = async () => {
|
|
4
|
+
const answers = await inquirer.prompt({ type: 'password', name: 'password', message: 'Enter password' });
|
|
5
|
+
return answers.password
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export { node as default };
|
package/index.html
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" dir="ltr">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title></title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<!-- <script src="./dist/browser/peernet.js">
|
|
9
|
-
</script> -->
|
|
10
|
-
|
|
11
|
-
<script type="module">
|
|
12
|
-
import './exports/browser/peernet.js';
|
|
13
|
-
(async () => {
|
|
14
|
-
const peernet = await new Peernet({network: 'leofcoin:peach', networkVersion: 'peach'})
|
|
15
|
-
peernet.addRequestHandler('lastBlock', () => new peernet.protos['peernet-response']({response: new TextEncoder().encode(100)}))
|
|
16
|
-
})()
|
|
17
|
-
</script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" dir="ltr">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title></title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<!-- <script src="./dist/browser/peernet.js">
|
|
9
|
+
</script> -->
|
|
10
|
+
|
|
11
|
+
<script type="module">
|
|
12
|
+
import './exports/browser/peernet.js';
|
|
13
|
+
(async () => {
|
|
14
|
+
const peernet = await new Peernet({network: 'leofcoin:peach', networkVersion: 'peach'})
|
|
15
|
+
peernet.addRequestHandler('lastBlock', () => new peernet.protos['peernet-response']({response: new TextEncoder().encode(100)}))
|
|
16
|
+
})()
|
|
17
|
+
</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@leofcoin/peernet",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"browser": "./exports/browser/peernet.js",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"import": "./exports/peernet.js",
|
|
9
|
-
"require": "./exports/commonjs/peernet.js",
|
|
10
|
-
"types": "./exports/types/peernet.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"./identity": {
|
|
13
|
-
"import": "./exports/identity.js",
|
|
14
|
-
"require": "./exports/commonjs/identity.js",
|
|
15
|
-
"types": "./exports/types/identity.d.ts"
|
|
16
|
-
},
|
|
17
|
-
"./browser": "./exports/browser/peernet.js"
|
|
18
|
-
},
|
|
19
|
-
"type": "module",
|
|
20
|
-
"engines": {
|
|
21
|
-
"node": ">=19.0.0"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "rollup -c",
|
|
25
|
-
"watch": "rollup -c -w",
|
|
26
|
-
"test": "npx mocha test/peernet.test.ts",
|
|
27
|
-
"server": "discovery-swarm-webrtc --port=4000",
|
|
28
|
-
"demo": "jsproject --serve ./ --port 6868"
|
|
29
|
-
},
|
|
30
|
-
"keywords": [],
|
|
31
|
-
"author": "",
|
|
32
|
-
"license": "MIT",
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@leofcoin/codec-format-interface": "^1.7.11",
|
|
35
|
-
"@leofcoin/codecs": "^1.0.6",
|
|
36
|
-
"@leofcoin/generate-account": "^2.0.3",
|
|
37
|
-
"@leofcoin/identity-utils": "^1.0.2",
|
|
38
|
-
"@leofcoin/multi-wallet": "^3.1.8",
|
|
39
|
-
"@leofcoin/storage": "^3.5.32",
|
|
40
|
-
"@netpeer/p2pt-swarm": "^1.3.6",
|
|
41
|
-
"@netpeer/swarm": "^0.8.16",
|
|
42
|
-
"@vandeurenglenn/base32": "^1.2.4",
|
|
43
|
-
"@vandeurenglenn/base58": "^1.1.9",
|
|
44
|
-
"@vandeurenglenn/debug": "^1.2.5",
|
|
45
|
-
"@vandeurenglenn/is-hex": "^1.1.1",
|
|
46
|
-
"@vandeurenglenn/little-pubsub": "^1.5.1",
|
|
47
|
-
"inquirer": "^10.2.2",
|
|
48
|
-
"multi-signature": "^1.3.1",
|
|
49
|
-
"qr-scanner": "^1.4.2",
|
|
50
|
-
"qrcode": "^1.5.4",
|
|
51
|
-
"socket-request-client": "^2.0.9",
|
|
52
|
-
"socket-request-server": "^1.6.17"
|
|
53
|
-
},
|
|
54
|
-
"devDependencies": {
|
|
55
|
-
"@jest/globals": "^29.7.0",
|
|
56
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
57
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
58
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
59
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
60
|
-
"@rollup/plugin-wasm": "^6.2.2",
|
|
61
|
-
"@types/bs58check": "^2.1.2",
|
|
62
|
-
"@types/node": "^22.5.5",
|
|
63
|
-
"@types/qrcode": "^1.5.5",
|
|
64
|
-
"@types/secp256k1": "^4.0.6",
|
|
65
|
-
"@types/varint": "^6.0.3",
|
|
66
|
-
"chai": "^5.1.1",
|
|
67
|
-
"cross-env": "^7.0.3",
|
|
68
|
-
"rollup": "^4.21.3",
|
|
69
|
-
"sinon": "^19.0.2"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@leofcoin/peernet",
|
|
3
|
+
"version": "1.1.82",
|
|
4
|
+
"description": "",
|
|
5
|
+
"browser": "./exports/browser/peernet.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./exports/peernet.js",
|
|
9
|
+
"require": "./exports/commonjs/peernet.js",
|
|
10
|
+
"types": "./exports/types/peernet.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./identity": {
|
|
13
|
+
"import": "./exports/identity.js",
|
|
14
|
+
"require": "./exports/commonjs/identity.js",
|
|
15
|
+
"types": "./exports/types/identity.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./browser": "./exports/browser/peernet.js"
|
|
18
|
+
},
|
|
19
|
+
"type": "module",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=19.0.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "rollup -c",
|
|
25
|
+
"watch": "rollup -c -w",
|
|
26
|
+
"test": "npx mocha test/peernet.test.ts",
|
|
27
|
+
"server": "discovery-swarm-webrtc --port=4000",
|
|
28
|
+
"demo": "jsproject --serve ./ --port 6868"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [],
|
|
31
|
+
"author": "",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@leofcoin/codec-format-interface": "^1.7.11",
|
|
35
|
+
"@leofcoin/codecs": "^1.0.6",
|
|
36
|
+
"@leofcoin/generate-account": "^2.0.3",
|
|
37
|
+
"@leofcoin/identity-utils": "^1.0.2",
|
|
38
|
+
"@leofcoin/multi-wallet": "^3.1.8",
|
|
39
|
+
"@leofcoin/storage": "^3.5.32",
|
|
40
|
+
"@netpeer/p2pt-swarm": "^1.3.6",
|
|
41
|
+
"@netpeer/swarm": "^0.8.16",
|
|
42
|
+
"@vandeurenglenn/base32": "^1.2.4",
|
|
43
|
+
"@vandeurenglenn/base58": "^1.1.9",
|
|
44
|
+
"@vandeurenglenn/debug": "^1.2.5",
|
|
45
|
+
"@vandeurenglenn/is-hex": "^1.1.1",
|
|
46
|
+
"@vandeurenglenn/little-pubsub": "^1.5.1",
|
|
47
|
+
"inquirer": "^10.2.2",
|
|
48
|
+
"multi-signature": "^1.3.1",
|
|
49
|
+
"qr-scanner": "^1.4.2",
|
|
50
|
+
"qrcode": "^1.5.4",
|
|
51
|
+
"socket-request-client": "^2.0.9",
|
|
52
|
+
"socket-request-server": "^1.6.17"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@jest/globals": "^29.7.0",
|
|
56
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
57
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
58
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
59
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
60
|
+
"@rollup/plugin-wasm": "^6.2.2",
|
|
61
|
+
"@types/bs58check": "^2.1.2",
|
|
62
|
+
"@types/node": "^22.5.5",
|
|
63
|
+
"@types/qrcode": "^1.5.5",
|
|
64
|
+
"@types/secp256k1": "^4.0.6",
|
|
65
|
+
"@types/varint": "^6.0.3",
|
|
66
|
+
"chai": "^5.1.1",
|
|
67
|
+
"cross-env": "^7.0.3",
|
|
68
|
+
"rollup": "^4.21.3",
|
|
69
|
+
"sinon": "^19.0.2"
|
|
70
|
+
}
|
|
71
|
+
}
|