fix: verify-deposit blockchain verification and wallet-based auth

- Drop auth.users FK constraints for wallet-based authentication
- Fix deferrable unique constraint on blockchain_tx_hash (ON CONFLICT compat)
- Rewrite block search: HTTP RPC + blake2b instead of WS-only @pezkuwi/api
- Add blockNumber hint for faster verification of older transactions
- Normalize SS58/hex addresses via base58 for reliable comparison
- DepositModal captures approximate block number after tx submission
This commit is contained in:
2026-02-23 12:16:15 +03:00
parent 7183e659c6
commit cbf98e4dc9
4 changed files with 297 additions and 84 deletions
+11 -1
View File
@@ -56,6 +56,7 @@ export function DepositModal({ isOpen, onClose, onSuccess }: DepositModalProps)
const [amount, setAmount] = useState('');
const [platformWallet, setPlatformWallet] = useState<string>('');
const [txHash, setTxHash] = useState('');
const [blockNumber, setBlockNumber] = useState<number | undefined>();
const [loading, setLoading] = useState(false);
const [copied, setCopied] = useState(false);
const [verifying, setVerifying] = useState(false);
@@ -77,6 +78,7 @@ export function DepositModal({ isOpen, onClose, onSuccess }: DepositModalProps)
setToken('HEZ');
setAmount('');
setTxHash('');
setBlockNumber(undefined);
setLoading(false);
setCopied(false);
setVerifying(false);
@@ -140,6 +142,13 @@ export function DepositModal({ isOpen, onClose, onSuccess }: DepositModalProps)
if (hash) {
setTxHash(hash);
// Capture approximate block number for faster verification
try {
const header = await api.rpc.chain.getHeader();
setBlockNumber(header.number.toNumber());
} catch {
// Non-critical - verification will still work via search
}
setStep('verify');
toast.success(t('p2pDeposit.txSent'));
}
@@ -174,7 +183,8 @@ export function DepositModal({ isOpen, onClose, onSuccess }: DepositModalProps)
txHash,
token,
expectedAmount: depositAmount,
walletAddress: selectedAccount?.address
walletAddress: selectedAccount?.address,
...(blockNumber ? { blockNumber } : {})
}
});