// Goal of this file is to inject all necessary device/signer dependency to coin-modules
import { createBridges } from "@ledgerhq/coin-canton/bridge/index";
import { getEnv } from "@ledgerhq/live-env";
import cantonResolver from "@ledgerhq/coin-canton/signer";
import makeCliTools from "@ledgerhq/coin-canton/test/cli";
import { LegacySignerCanton } from "@ledgerhq/live-signer-canton";
import { createResolver, executeWithSigner } from "../../bridge/setup";
import cantonBridgeMock from "./bridge/mock";
import { getCurrencyConfiguration } from "../../config";
const createSigner = (transport) => {
    return new LegacySignerCanton(transport);
};
const getCurrencyConfig = (currency) => {
    if (!currency) {
        throw new Error("currency not defined");
    }
    return getCurrencyConfiguration(currency);
};
const bridge = getEnv("MOCK")
    ? cantonBridgeMock
    : createBridges(executeWithSigner(createSigner), getCurrencyConfig);
const resolver = createResolver(createSigner, cantonResolver);
const cliTools = makeCliTools();
export { bridge, cliTools, resolver };
//# sourceMappingURL=setup.js.map