WalletConnect not updating modal balance after payment transaction in React app #2515
Unanswered
Herculesdfy
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Not possible at the moment but we want to improve this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a React application where I use WalletConnect for handling crypto payments. The payment flow involves connecting a wallet, initiating a transaction, and then updating the user balance(in the wallet-connect modal). However, after a successful transaction, the user balance is not updating as expected. Here are the relevant parts of my code:
`
`
function CoinPayment() {
let { order } = useMatch().data as Partial;
let { orderId } = useMatch().params as { orderId: string };
const navigate = useNavigate();
let { addToast } = useNotifications();
const account = useAccount();
const { address, chainId } = account;
const { data: balanceData, refetch: refetchBalance } = useBalance({ address });
const [selectedCurrency, setSelectedCurrency] = useState<"ETH" | "MATIC.POLY" | "BNB.BSC">(account.chainId === 1 ? "ETH" :
account.chainId === 137 ? "MATIC.POLY" : "BNB.BSC");
const [isLoading, setIsLoading] = useState(false);
const [openError, setOpenError] = useState(false);
const [openSuccess, setOpenSuccess] = useState(false);
}`
I have tried using the refetchBalance after the payment transaction, it gets the correct balance but I am unsure of how to update the wallet-connect modal's balance.
<Box> <w3m-button /> </Box>
Beta Was this translation helpful? Give feedback.
All reactions