diff --git a/src/lib/cosmos/fees.ts b/src/lib/cosmos/fees.ts index 67f7ec0..f983e8e 100644 --- a/src/lib/cosmos/fees.ts +++ b/src/lib/cosmos/fees.ts @@ -42,6 +42,8 @@ export interface SimulateResult { gasWanted: number; } +const BZE_SIMULATE_PROXY_URL = 'https://api.vidulum.app/bze/cosmos/tx/v1beta1/simulate'; + // Cache for params let tradebinParamsCache: TradebinParams | null = null; let tradebinParamsCacheTime = 0; @@ -164,7 +166,11 @@ export async function simulateTransaction( const txBytes = TxRaw.encode(txRaw).finish(); - const response = await fetch(`${restEndpoint}/cosmos/tx/v1beta1/simulate`, { + const simulateUrl = restEndpoint.includes('rest.getbze.com') + ? BZE_SIMULATE_PROXY_URL + : `${restEndpoint}/cosmos/tx/v1beta1/simulate`; + + const response = await fetch(simulateUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ diff --git a/src/popup/pages/Swap.tsx b/src/popup/pages/Swap.tsx index abbfb62..43ba9fd 100644 --- a/src/popup/pages/Swap.tsx +++ b/src/popup/pages/Swap.tsx @@ -25,6 +25,7 @@ import { Keypair, PublicKey } from '@solana/web3.js'; */ const VIDULUM_FEE_BPS = import.meta.env.VIDULUM_FEE_BPS || ''; const VIDULUM_FEE_BASE_ADDRESS = import.meta.env.VIDULUM_FEE_BASE_ADDRESS || ''; +const SKIP_API_URL = 'https://api.vidulum.app/skip/api/skip/v2'; const skipSvmChainIdByNetworkId: Record = { 'solana-mainnet': 'solana', @@ -292,16 +293,24 @@ const SwapPage: React.FC = ({ onBack }) => { for (const network of enabledNetworks) { if (isCosmosNetwork(network)) { - filter[network.id] = undefined; + if (connectedAddresses[network.id]) { + filter[network.id] = undefined; + } } else if (isEvmNetwork(network)) { - filter[String(network.chainId)] = undefined; + const skipChainId = String(network.chainId); + if (connectedAddresses[skipChainId]) { + filter[skipChainId] = undefined; + } } else if (isSvmNetwork(network)) { - filter[getSkipSvmChainId(network)] = undefined; + const skipChainId = getSkipSvmChainId(network); + if (connectedAddresses[skipChainId]) { + filter[skipChainId] = undefined; + } } } return filter; - }, [getEnabledNetworks]); + }, [getEnabledNetworks, connectedAddresses]); /** * Build chainIdsToAffiliates for Vidulum's fee collection. @@ -560,6 +569,7 @@ const SwapPage: React.FC = ({ onBack }) => { = ({ onBack }) => { }} // --- Theme --- theme={widgetTheme} + // --- Disable external WalletConnect integration --- + walletConnect={{ + options: null, + walletConnectModal: null, + }} // --- Custom endpoints from our failover system --- endpointOptions={endpointOptions} // --- Affiliate fees: 0.75% to Vidulum on every chain --- chainIdsToAffiliates={chainIdsToAffiliates} // --- Injected wallet: pass connected addresses + Cosmos signer --- connectedAddresses={connectedAddresses} + hideAssetsUnlessWalletTypeConnected={true} getCosmosSigner={getCosmosSigner} getEvmSigner={getEvmSigner} getSvmSigner={getSvmSigner} diff --git a/src/web/index.html b/src/web/index.html index e4af415..855e016 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -3,7 +3,40 @@ - Vidulum Wallet + Vidulum Wallet | Cross-Chain Wallet for Cosmos, EVM, and Solana + + + + + + + + + + +