"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const client_1 = require("./client");
const connection_1 = require("./services/connection");
const detect_1 = require("./services/detect");
const member_node_factory_1 = require("./services/member-node-factory");
const state_1 = require("./services/state");
const wallet_node_factory_1 = require("./services/wallet-node-factory");
const rest_service_1 = require("./api/rest-service");
const jwt_1 = require("./api/jwt");
function connect(endpoint, production = false) {
    const stateService = new state_1.StateService();
    const detectionService = new detect_1.DetectionService(production);
    const walletNodeFactory = new wallet_node_factory_1.WalletNodeFactory();
    const memberNodeFactory = new member_node_factory_1.MemberNodeFactory();
    const connectionService = new connection_1.ConnectionService(stateService, detectionService, walletNodeFactory, memberNodeFactory);
    const restService = new rest_service_1.RestService(connectionService, stateService);
    const jwtService = new jwt_1.SetlJWT(endpoint, stateService, connectionService);
    return new client_1.SetlClient(stateService, connectionService, restService, jwtService, endpoint);
}
exports.connect = connect;
