Skip to content

Commit

Permalink
chore: add ws receipt in example
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Nov 27, 2023
1 parent c9cef97 commit 273d5a5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions blog/2023-11-27-echo-introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ const rpcRequest = JSON.stringify({
params: [bundle],
});

// listen for receipt notifications from Echo
echoClient.on("message", async (data: Buffer) => {
let text = data.toString("utf-8");
console.log("Received message from Echo:", text);
});

echoClient.send(rpcRequest);
```

Expand Down Expand Up @@ -82,6 +88,12 @@ const rpcRequest = JSON.stringify({
params: [approvalTxPayload],
});

// listen for receipt notifications from Echo
echoClient.on("message", async (data: Buffer) => {
let text = data.toString("utf-8");
console.log("Received message from Echo:", text);
});

console.log("Sending transaction to Echo:", rpcRequest);
echoClient.send(rpcRequest);

Expand Down

0 comments on commit 273d5a5

Please sign in to comment.