arrow-left 강좌 허브
레슨 1: Use React Js To Monitor Transactions On An Account Via Transaction Stream
예상 읽기 시간:

20 minutes

난이도:

Advanced

핵심 요약:

Use the useTransactionLog() hook in React to monitor real-time payments on the XRP Ledger, track transactions entering and leaving an account, and visualize live transaction streams without requiring manual requests.

레슨 5

Use React.js to monitor transactions on an account via transaction stream

Real-time updates through transaction streams

Just like in the last lesson, in the following code sandbox, we start with a simple UI by creating a source wallet component and a destination account component. The main difference in this demonstration is that we’ll use a transaction stream to monitor payments that transfer into our destination account and out of our source wallet. For this demonstration, let’s pretend that we don’t know the sender but we’re trying to use a transaction stream to see the payments that are leaving that account.

Get a transaction stream of an account with useTransactionLog()

We’ll use useTransactionLog() to create a transaction stream to monitor the balance of the destination wallet and any payments that go into that account. Start by sending XRP from the source wallet to the destination wallet. In the component below, you’ll see two checkboxes to monitor both the sender’s/source account and the destination account. Once you send XRP, you’ll see the payment show up in the list of activity.
레슨 종료

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