forked from OpenST/openst.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (36 loc) · 1.04 KB
/
index.js
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
47
48
49
50
51
52
'use strict';
/**
* Load openST Platform module
*/
const InstanceComposer = require('./instance_composer');
const version = require('./package.json').version;
require('./providers/ChainWeb3');
require('./lib/Signers');
require('./lib/Setup');
require('./lib/Contracts');
const OpenST = function(gethEndPoint) {
const oThis = this;
oThis.version = version;
oThis.configurations = Object.assign({}, { gethEndPoint: gethEndPoint });
const _instanceComposer = new InstanceComposer(oThis.configurations);
oThis.ic = function() {
return _instanceComposer;
};
let _web3 = oThis.ic().chainWeb3();
oThis.web3 = function() {
return _web3;
};
oThis.contracts = oThis.ic().Contracts();
oThis.setup = oThis.ic().Setup();
oThis.signers = oThis.ic().Signers();
oThis.utils = OpenST.utils;
};
OpenST.prototype = {
constructor: OpenST,
configurations: null
};
OpenST.utils = {
GethSignerService: require('./utils/GethSignerService'),
ExecutableTransaction: require('./utils/ExecutableTransaction')
};
module.exports = OpenST;