"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 bridge_1 = require("@ledgerhq/coin-celo/bridge");
const cli_transaction_1 = __importDefault(require("@ledgerhq/coin-celo/cli-transaction"));
const hw_getAddress_1 = __importDefault(require("@ledgerhq/coin-celo/hw-getAddress"));
const hw_app_celo_1 = __importDefault(require("@ledgerhq/hw-app-celo"));
const setup_1 = require("../../bridge/setup");
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
const index_1 = require("@ledgerhq/coin-evm/api/index");
const config_1 = require("../../config");
const createSigner = (transport) => new hw_app_celo_1.default(transport);
// NOTE Create an unused instance of EVM API with Celo configuration.
// It has the side effect of initializing the EVM coin config as well as injecting
// the input Celo config.
// TODO Remove this hack while deleting the Celo bridge
const getCurrencyConfig = () => {
    return { info: (0, config_1.getCurrencyConfiguration)((0, cryptoassets_1.getCryptoCurrencyById)("celo")) };
};
(0, index_1.createApi)(getCurrencyConfig, "celo");
const bridge = (0, bridge_1.createBridges)((0, setup_1.executeWithSigner)(createSigner));
exports.bridge = bridge;
const resolver = (0, setup_1.createResolver)(createSigner, hw_getAddress_1.default);
exports.resolver = resolver;
const cliTools = (0, cli_transaction_1.default)();
exports.cliTools = cliTools;
//# sourceMappingURL=setup.js.map