import { client } from '@/client'; import { getRelayFeeBySimulate } from '@/utils/simulate'; import { ISimulateGasFee } from '@bnb-chain/greenfield-js-sdk'; import { useState } from 'react'; import { parseEther } from 'viem'; import { useAccount } from 'wagmi'; export const Withdraw = () => { const { address } = useAccount(); const [transferoutInfo, setTransferoutInfo] = useState({ to: '0x0000000000000000000000000000000000000001', amount: '1', gasLimit: '210000', }); const [simulateInfo, setSimulateInfo] = useState(null); const [transferOutRelayFee, setTransferOutRelayFee] = useState(''); return (

Withdraw

to : { setTransferoutInfo({ ...transferoutInfo, to: e.target.value }); }} />
amount: { setTransferoutInfo({ ...transferoutInfo, amount: e.target.value }); }} />
gas limit: { setTransferoutInfo({ ...transferoutInfo, gasLimit: e.target.value }); }} />

relay fee: {transferOutRelayFee}
gas fee: {simulateInfo?.gasFee}
); };