-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
46 lines (36 loc) · 1.29 KB
/
index.js
File metadata and controls
46 lines (36 loc) · 1.29 KB
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
44
45
46
var Session = require('./dist/Session')
var joystream = require('bindings')('JoyStreamAddon').joystream
var libtorrent = require('bindings')('JoyStreamAddon').libtorrent
// Sanity check - ensure we are linking with expected core libraries
const linked = joystream.protocolVersion
const expected = 4
if (linked !== expected) {
throw Error('Wrong Protocol Version linked. expected=v' + expected + ', linked=v' + linked)
}
module.exports = {
// Connection Statemachine Protocol major version
protocolVersion: joystream.protocolVersion,
// Libtorrent Interaction mode
LibtorrentInteraction: joystream.LibtorrentInteraction,
// Connection State
ConnectionInnerState: joystream.InnerStateType,
// Session Mode and State
SessionMode: joystream.SessionMode,
SessionState: joystream.SessionState,
BuyingState: joystream.BuyingState,
SellingState: joystream.SellingState,
// BEPSupport
BEPSupportStatus: joystream.BEPSupportStatus,
// Torrent State
TorrentState: libtorrent.TorrentState,
// Alerts
LibtorrentAlertType: libtorrent.AlertType,
LibtorrentAlertNotification: libtorrent.AlertNotification,
// Classes
TorrentInfo: libtorrent.TorrentInfo,
Session: Session,
// Payment channel, helper methods
paymentChannel: {
commitmentToOutput: joystream.commitmentToOutput
}
}