Checks if a delegated provider or the local SDK worker is responsive.
function heartbeat(params?: { delegate?: DelegateBase }): Promise<HeartbeatResponse>;
Sends a heartbeat round-trip to verify that a delegated provider is online or that the local SDK worker is responsive. When called without arguments, checks the local worker.
// Check if a delegated provider is onlinetry { await heartbeat({ delegate: { topic: "topicHex", providerPublicKey: "peerHex", timeout: 3000 }, }); console.log("Provider is online");} catch { console.log("Provider is offline");}// Check if the local SDK worker is responsiveawait heartbeat();