"use strict";
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolver = exports.cliTools = exports.bridge = void 0;
const index_1 = require("@ledgerhq/coin-canton/bridge/index");
const live_env_1 = require("@ledgerhq/live-env");
const signer_1 = __importDefault(require("@ledgerhq/coin-canton/signer"));
const cli_1 = __importDefault(require("@ledgerhq/coin-canton/test/cli"));
const live_signer_canton_1 = require("@ledgerhq/live-signer-canton");
const setup_1 = require("../../bridge/setup");
const mock_1 = __importDefault(require("./bridge/mock"));
const config_1 = require("../../config");
const createSigner = (transport) => {
    return new live_signer_canton_1.LegacySignerCanton(transport);
};
const getCurrencyConfig = (currency) => {
    if (!currency) {
        throw new Error("currency not defined");
    }
    return (0, config_1.getCurrencyConfiguration)(currency);
};
const bridge = (0, live_env_1.getEnv)("MOCK")
    ? mock_1.default
    : (0, index_1.createBridges)((0, setup_1.executeWithSigner)(createSigner), getCurrencyConfig);
exports.bridge = bridge;
const resolver = (0, setup_1.createResolver)(createSigner, signer_1.default);
exports.resolver = resolver;
const cliTools = (0, cli_1.default)();
exports.cliTools = cliTools;
//# sourceMappingURL=setup.js.map