"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAlpacaApi = void 0;
const index_1 = require("@ledgerhq/coin-xrp/api/index");
const index_2 = require("@ledgerhq/coin-stellar/api/index");
const index_3 = require("@ledgerhq/coin-canton/api/index");
const index_4 = require("@ledgerhq/coin-tron/api/index");
const index_5 = require("@ledgerhq/coin-evm/api/index");
const index_6 = require("@ledgerhq/coin-tezos/api/index");
const config_1 = require("../../../config");
const network_alpaca_1 = require("./network/network-alpaca");
const utils_1 = require("../utils");
function getAlpacaApi(network, kind) {
    if (kind === "local") {
        const currency = (0, utils_1.findCryptoCurrencyByNetwork)(network);
        switch (currency?.family) {
            case "xrp":
                return (0, index_1.createApi)((0, config_1.getCurrencyConfiguration)(currency)); // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
            case "stellar":
                return (0, index_2.createApi)((0, config_1.getCurrencyConfiguration)(currency));
            case "canton":
                return (0, index_3.createApi)((0, config_1.getCurrencyConfiguration)(currency));
            case "tron":
                return (0, index_4.createApi)((0, config_1.getCurrencyConfiguration)(currency));
            case "evm":
                return (0, index_5.createApi)((0, config_1.getCurrencyConfiguration)(currency), currency.id);
            case "tezos":
                return (0, index_6.createApi)((0, config_1.getCurrencyConfiguration)(currency));
        }
    }
    return (0, network_alpaca_1.getNetworkAlpacaApi)(network);
}
exports.getAlpacaApi = getAlpacaApi;
//# sourceMappingURL=index.js.map