arrow-left 강좌 허브
레슨 1: Use React Js To View An Account Balance
예상 읽기 시간:

20 minutes

난이도:

Advanced

핵심 요약:

Use the useBalance() hook in React to track and monitor XRP account balances in real-time through a responsive UI, without signing transactions or needing wallet ownership.

레슨 4

Use React.js to view an account balance

React.js and useBalance() for live account data

In the following code sandbox, we start with a simple UI by creating a source wallet component and a destination account component. For demonstration purposes, we need control of the sender wallet, but let's focus on what’s happening with the destination wallet. We’ll use useBalance() to send a request to monitor the balance of the destination wallet. Remember, a request doesn’t require signing a transaction, so you can use this hook to check the balance of any account number you know, even if you don’t own the wallet yourself. Try sending XRP from the source wallet to the destination wallet. The useBalance() request will update the balance of the destination wallet once the XRP hits the account!
레슨 종료

이제 지식을 확인할 시간입니다! 블록체인 기술에 관한 다음 질문에 답해 보세요: