You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start a new project by creating an empty folder, then move into that folder and use [NPM](https://www.npmjs.com/) to install the latest version of xrpl.js:
80
81
@@ -145,31 +146,32 @@ If you want to generate a wallet without funding it, you can create a new `Walle
145
146
To use an existing wallet seed encoded in [base58][], you can create a `Wallet` instance from it.
146
147
{%/step %}
147
148
149
+
{% step id="query-xrpl-tag"%}
148
150
### 4. Query the XRP Ledger
149
151
150
-
{% step id="query-xrpl-tag"%}
151
152
Use the Client's `request()` method to access the XRP Ledger's [WebSocketAPI](../../../references/http-websocket-apis/api-conventions/request-formatting.md).
152
153
{%/step %}
153
154
155
+
{% step id="listen-for-events-tag"%}
154
156
### 5. Listen for Events
155
157
156
-
{% step id="listen-for-events-tag"%}
157
158
You can set up handlers for various types of events in`xrpl.js`, such as whenever the XRP Ledger's [consensus process](../../../concepts/consensus-protocol/index.md) produces a new [ledger version](../../../concepts/ledgers/index.md). To do that, first call the [subscribe method][] to get the type of events you want, then attach an event handler using the `on(eventType, callback)` method of the client.
Disconnect when done so Node.js can end the process. The example code waits 10 seconds before disconnecting to allow time for the ledger event listener to receive and display events.
Disconnect from the ledger when done. The example code waits 10 seconds before disconnecting to allow time for the ledger event listener to receive and display events.
0 commit comments