forked from mosaicdao/mosaic.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
112 lines (93 loc) · 2.93 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
112
'use strict';
const AbiBinProvider = require('./src/AbiBinProvider');
const Chain = require('./src/Chain');
const ChainSetup = require('./src/ChainSetup');
const Contracts = require('./src/Contracts');
const Facilitator = require('./src/Facilitator');
const Redeemer = require('./src/Redeemer');
const Setup = require('./src/Setup');
const Staker = require('./src/Staker');
const StakeHelper = require('./src/helpers/StakeHelper');
const TypedData = require('./src/utils/EIP712SignerExtension/TypedData');
const Anchor = require('./src/ContractInteract/Anchor');
const EIP20CoGateway = require('./src/ContractInteract/EIP20CoGateway');
const EIP20Gateway = require('./src/ContractInteract/EIP20Gateway');
const EIP20Token = require('./src/ContractInteract/EIP20Token');
const GatewayLib = require('./src/ContractInteract/GatewayLib');
const MerklePatriciaProof = require('./src/ContractInteract/MerklePatriciaProof');
const MessageBus = require('./src/ContractInteract/MessageBus');
const Mosaic = require('./src/Mosaic');
const Organization = require('./src/ContractInteract/Organization');
const OSTPrime = require('./src/ContractInteract/OSTPrime');
const ProofGenerator = require('./src/utils/ProofGenerator');
const UtilityToken = require('./src/ContractInteract/UtilityToken');
const Utils = require('./src/utils/Utils');
// FIXME: https://github.com/openst/mosaic.js/issues/66 Entry should not run the extender.
require('./src/utils/EIP712SignerExtension/extender')();
/*
* The below construct with the Helpers class was added to ensure the printing of the
* deprecation warnings for deprecated classes (StakeHelper and ChainSetup).
* Once the deprecated code is removed, it should be simplified.
*/
class Helpers {
static get StakeHelper() {
Utils.deprecationNoticeStakeHelper();
return StakeHelper;
}
}
/**
* Exports mosaic class and adds static getters for all other modules that should be exported.
*/
class MosaicWithExports extends Mosaic {
static get AbiBinProvider() {
return AbiBinProvider;
}
static get Chain() {
return Chain;
}
static get ChainSetup() {
Utils.deprecationNoticeChainSetup('ChainSetup');
return ChainSetup;
}
static get Contracts() {
return Contracts;
}
static get ContractInteract() {
return {
Anchor,
EIP20CoGateway,
EIP20Gateway,
EIP20Token,
GatewayLib,
MerklePatriciaProof,
MessageBus,
Organization,
OSTPrime,
UtilityToken,
};
}
static get Facilitator() {
return Facilitator;
}
static get Helpers() {
return Helpers;
}
static get Redeemer() {
return Redeemer;
}
static get Setup() {
return Setup;
}
static get Staker() {
return Staker;
}
static get Utils() {
return {
EIP712TypedData: TypedData,
ProofGenerator,
createSecretHashLock: Utils.createSecretHashLock,
sendTransaction: Utils.sendTransaction,
};
}
}
module.exports = MosaicWithExports;