"use strict";
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;
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
const bridge_1 = require("@ledgerhq/coin-tron/bridge");
const signer_1 = __importDefault(require("@ledgerhq/coin-tron/signer"));
const cli_1 = __importDefault(require("@ledgerhq/coin-tron/test/cli"));
const cryptoassets_1 = require("@ledgerhq/cryptoassets");
const hw_app_trx_1 = __importDefault(require("@ledgerhq/hw-app-trx"));
const setup_1 = require("../../bridge/setup");
const config_1 = require("../../config");
const createSigner = (transport) => {
    const trx = new hw_app_trx_1.default(transport);
    return {
        getAddress: (path, boolDisplay) => trx.getAddress(path, boolDisplay),
        sign: (path, rawTxHex, tokenSignatures) => trx.signTransaction(path, rawTxHex, tokenSignatures),
    };
};
const getCurrencyConfig = () => {
    return (0, config_1.getCurrencyConfiguration)((0, cryptoassets_1.getCryptoCurrencyById)("tron"));
};
const bridge = (0, bridge_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