2018-10-01 18:10:26 +02:00
|
|
|
import Config from "../models/Config";
|
2018-10-01 18:30:53 +02:00
|
|
|
import OceanAuth from "./Auth";
|
|
|
|
import OceanMarket from "./Market";
|
|
|
|
import OceanToken from "./Token";
|
2018-10-01 18:10:26 +02:00
|
|
|
import Web3Helper from "./Web3Helper";
|
|
|
|
|
|
|
|
export default class Keeper {
|
|
|
|
|
|
|
|
public static async getInstance(config: Config, helper: Web3Helper) {
|
|
|
|
|
|
|
|
const contracts = new Keeper(config, helper);
|
|
|
|
|
|
|
|
contracts.market = await OceanMarket.getInstance(config, helper);
|
|
|
|
contracts.auth = await OceanAuth.getInstance(config, helper);
|
|
|
|
contracts.token = await OceanToken.getInstance(config, helper);
|
|
|
|
|
|
|
|
return contracts;
|
|
|
|
}
|
|
|
|
|
|
|
|
public web3Helper: Web3Helper;
|
|
|
|
public token: OceanToken;
|
|
|
|
public market: OceanMarket;
|
|
|
|
public auth: OceanAuth;
|
|
|
|
|
|
|
|
private config: Config;
|
|
|
|
|
|
|
|
private constructor(config: Config, helper: Web3Helper) {
|
|
|
|
this.config = config;
|
|
|
|
this.web3Helper = helper;
|
|
|
|
}
|
|
|
|
}
|