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!
課程單元結束

接下來測試一下你的知識!看看你能否回答這些關於區塊鏈技術的問題: