import { ChainType } from '@0xsquid/squid-types';
import { HANA_ID, LOBSTR_ID, FREIGHTER_ID, XBULL_ID, RABET_ID, HOTWALLET_ID, ALBEDO_ID } from '@creit.tech/stellar-wallets-kit';
import { LEDGER_ID } from '@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs';
import { a as WindowWalletFlag, w as walletIconBaseUrl, d as definedInWindow } from './index-DSDEoKAQ.js';
import 'viem';
import 'react';
import '@tanstack/react-query';
import '@cosmjs/encoding';
import 'bitcoinjs-lib';
import '@bitcoinerlab/secp256k1';
import 'axios';
import '@walletconnect/modal';
import '@walletconnect/universal-provider';
import 'ripple-address-codec';
import '@solana/spl-token';
import '@solana/wallet-standard-wallet-adapter-base';
import '@solana/web3.js';
import '@stellar/stellar-sdk';
import '@mysten/wallet-standard';
import 'ethers';
import 'bignumber.js';
import 'countries-list';
import 'currency-symbol-map';
import 'fuse.js';
import 'zustand';
import 'zustand/middleware';
import 'wagmi';
import '@safe-global/safe-apps-sdk';
import '@wallet-standard/core';
import '@mysten/slush-wallet';
import '@cosmjs/stargate';
import '@mysten/sui/client';
import 'wagmi/connectors';
import '@cosmjs/proto-signing';
import '@mysten/sui/transactions';
import '@cosmjs/cosmwasm-stargate';
import '@injectivelabs/sdk-ts/dist/cjs/core/stargate/index.js';
import '@0xsquid/sdk';
import 'viem/chains';

const walletOverrides = {
    [ALBEDO_ID]: {
        icon: `${walletIconBaseUrl}/albedo.webp`,
        isInstalled: () => false,
        skipInstallCheck: true,
        connectorId: "albedo",
    },
    [HOTWALLET_ID]: {
        icon: `${walletIconBaseUrl}/hot.webp`,
        windowFlag: WindowWalletFlag.HotWallet,
        skipInstallCheck: true,
        connectorId: "hotWallet",
    },
    [RABET_ID]: {
        icon: `${walletIconBaseUrl}/rabet.webp`,
    },
    [LEDGER_ID]: {
        icon: `${walletIconBaseUrl}/ledger_stellar_snap.webp`,
    },
    [XBULL_ID]: {
        icon: `${walletIconBaseUrl}/xbull.webp`,
        windowFlag: WindowWalletFlag.XBull,
        skipInstallCheck: true,
        connectorId: "xBull",
    },
    [FREIGHTER_ID]: {
        connectorId: "freighter",
    },
    [LOBSTR_ID]: {
        connectorId: "lobstr",
    },
    [HANA_ID]: {
        connectorId: "hanaWallet",
    },
};
function formatStellarWallet(connector, isAvailable) {
    const { productName, productId, productIcon, productUrl } = connector;
    const overrides = walletOverrides[productId];
    const icon = overrides?.icon || productIcon;
    const connectorId = overrides?.connectorId || productId;
    return {
        connectorId,
        name: productName,
        connectorName: productName,
        type: ChainType.STELLAR,
        icon,
        windowFlag: productName,
        isMobile: false,
        isInstalled: overrides?.windowFlag
            ? () => definedInWindow(overrides.windowFlag, window)
            : overrides?.isInstalled || (() => isAvailable),
        skipInstallCheck: overrides?.skipInstallCheck,
        connector,
        url: productUrl,
    };
}

export { formatStellarWallet };
//# sourceMappingURL=stellarService.client-Cnzwca-X.js.map
