fix: resolve TX-DYNAMIC 404 error and enhance multi-chain API support

This commit is contained in:
mstfyldz
2026-03-13 03:03:35 +03:00
parent 7c9fa48d0b
commit 5f0df83686
5 changed files with 65 additions and 65 deletions

View File

@@ -15,8 +15,7 @@ interface CryptoCheckoutProps {
currency: string;
txId: string;
wallets?: {
EVM: string;
SOLANA: string;
[key: string]: any;
};
onSuccess: (txHash: string) => void;
}
@@ -35,8 +34,10 @@ export default function CryptoCheckout({ amount, currency, txId, wallets, onSucc
// Update address based on selected network
useEffect(() => {
if (wallets) {
const addr = selectedNetwork.id === 'SOLANA' ? wallets.SOLANA : wallets.EVM;
setDepositAddress(addr);
// Support all 4 networks and both string/object formats
const rawVal = wallets[selectedNetwork.id] || wallets['EVM'];
const addr = typeof rawVal === 'string' ? rawVal : rawVal?.address;
setDepositAddress(addr || 'Adres Bulunamadı');
}
}, [selectedNetwork, wallets]);