fix: resolve TX-DYNAMIC 404 error and enhance multi-chain API support
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user