"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var v=require("events"),n=require("@walletconnect/time"),l=require("@walletconnect/events");class r extends l.IEvents{constructor(e){super()}}const s=n.FIVE_SECONDS,a={pulse:"heartbeat_pulse"};class i extends r{constructor(e){super(e),this.events=new v.EventEmitter,this.interval=s,this.interval=e?.interval||s}static async init(e){const t=new i(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),n.toMiliseconds(this.interval))}pulse(){this.events.emit(a.pulse)}}exports.HEARTBEAT_EVENTS=a,exports.HEARTBEAT_INTERVAL=s,exports.HeartBeat=i,exports.IHeartBeat=r;
//# sourceMappingURL=index.cjs.js.map
