From 1b399d1933d79413b8cdaa5b08a6f1887f6d9f22 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 8 Apr 2025 14:12:19 +1200 Subject: [PATCH] add other examples for finding contact --- examples/nodejs_get_repeater_status.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/nodejs_get_repeater_status.js b/examples/nodejs_get_repeater_status.js index 2939741..a979b62 100644 --- a/examples/nodejs_get_repeater_status.js +++ b/examples/nodejs_get_repeater_status.js @@ -10,10 +10,13 @@ connection.on("connected", async () => { console.log("Connected"); // find contact + // const contact = await connection.findContactByName("Liam's Solar Repeater"); // const contact = await connection.findContactByPublicKeyPrefix([0x93, 0x5c, 0x6b, 0x69]); - const contact = await connection.findContactByName("Liam's Solar Repeater"); + // const contact = await connection.findContactByPublicKeyPrefix(Buffer.from("935c6b69", "hex")); + const contact = await connection.findContactByPublicKeyPrefix(Buffer.from("935c6b694200644710a374c250c76f7aed9ec2ff3e60261447d4eda7c246ce5d", "hex")); if(!contact){ console.log("Contact not found"); + await connection.close(); return; }