'use strict';

var squidTypes = require('@0xsquid/squid-types');
var stellarWalletsKit = require('@creit.tech/stellar-wallets-kit');
var ledger_module = require('@creit.tech/stellar-wallets-kit/modules/ledger.module.mjs');
var index = require('./index-BXuWPj5X.js');
require('viem');
require('react');
require('@tanstack/react-query');
require('@cosmjs/encoding');
require('bitcoinjs-lib');
require('@bitcoinerlab/secp256k1');
require('axios');
require('@walletconnect/modal');
require('@walletconnect/universal-provider');
require('ripple-address-codec');
require('@solana/spl-token');
require('@solana/wallet-standard-wallet-adapter-base');
require('@solana/web3.js');
require('@stellar/stellar-sdk');
require('@mysten/wallet-standard');
require('ethers');
require('bignumber.js');
require('countries-list');
require('currency-symbol-map');
require('fuse.js');
require('zustand');
require('zustand/middleware');
require('wagmi');
require('@safe-global/safe-apps-sdk');
require('@wallet-standard/core');
require('@mysten/slush-wallet');
require('@cosmjs/stargate');
require('@mysten/sui/client');
require('wagmi/connectors');
require('@cosmjs/proto-signing');
require('@mysten/sui/transactions');
require('@cosmjs/cosmwasm-stargate');
require('@injectivelabs/sdk-ts/dist/cjs/core/stargate/index.js');
require('@0xsquid/sdk');
require('viem/chains');

const walletOverrides = {
    [stellarWalletsKit.ALBEDO_ID]: {
        icon: `${index.walletIconBaseUrl}/albedo.webp`,
        isInstalled: () => false,
        skipInstallCheck: true,
        connectorId: "albedo",
    },
    [stellarWalletsKit.HOTWALLET_ID]: {
        icon: `${index.walletIconBaseUrl}/hot.webp`,
        windowFlag: index.WindowWalletFlag.HotWallet,
        skipInstallCheck: true,
        connectorId: "hotWallet",
    },
    [stellarWalletsKit.RABET_ID]: {
        icon: `${index.walletIconBaseUrl}/rabet.webp`,
    },
    [ledger_module.LEDGER_ID]: {
        icon: `${index.walletIconBaseUrl}/ledger_stellar_snap.webp`,
    },
    [stellarWalletsKit.XBULL_ID]: {
        icon: `${index.walletIconBaseUrl}/xbull.webp`,
        windowFlag: index.WindowWalletFlag.XBull,
        skipInstallCheck: true,
        connectorId: "xBull",
    },
    [stellarWalletsKit.FREIGHTER_ID]: {
        connectorId: "freighter",
    },
    [stellarWalletsKit.LOBSTR_ID]: {
        connectorId: "lobstr",
    },
    [stellarWalletsKit.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: squidTypes.ChainType.STELLAR,
        icon,
        windowFlag: productName,
        isMobile: false,
        isInstalled: overrides?.windowFlag
            ? () => index.definedInWindow(overrides.windowFlag, window)
            : overrides?.isInstalled || (() => isAvailable),
        skipInstallCheck: overrides?.skipInstallCheck,
        connector,
        url: productUrl,
    };
}

exports.formatStellarWallet = formatStellarWallet;
//# sourceMappingURL=stellarService.client-SFl8OhRJ.js.map
