@matter/protocol 0.16.0-alpha.0-20250816-d22ad240d → 0.16.0-alpha.0-20250819-0a388db8b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/dist/cjs/action/Val.d.ts +6 -0
  2. package/dist/cjs/action/Val.d.ts.map +1 -1
  3. package/dist/cjs/action/Val.js.map +1 -1
  4. package/dist/cjs/action/client/ClientInteraction.d.ts +1 -1
  5. package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
  6. package/dist/cjs/action/client/ClientInteraction.js +4 -4
  7. package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
  8. package/dist/cjs/action/client/ClientSubscription.d.ts +2 -1
  9. package/dist/cjs/action/client/ClientSubscription.d.ts.map +1 -1
  10. package/dist/cjs/action/client/ClientSubscriptionHandler.js +2 -2
  11. package/dist/cjs/action/client/ClientSubscriptionHandler.js.map +1 -1
  12. package/dist/cjs/action/client/ClientSubscriptions.d.ts.map +1 -1
  13. package/dist/cjs/action/client/ClientSubscriptions.js +11 -7
  14. package/dist/cjs/action/client/ClientSubscriptions.js.map +1 -1
  15. package/dist/cjs/action/request/Subscribe.d.ts +6 -6
  16. package/dist/cjs/action/request/Subscribe.d.ts.map +1 -1
  17. package/dist/cjs/action/request/Subscribe.js +11 -9
  18. package/dist/cjs/action/request/Subscribe.js.map +1 -1
  19. package/dist/cjs/advertisement/Advertisement.d.ts +3 -3
  20. package/dist/cjs/advertisement/Advertisement.d.ts.map +1 -1
  21. package/dist/cjs/advertisement/Advertisement.js +5 -5
  22. package/dist/cjs/advertisement/Advertisement.js.map +1 -1
  23. package/dist/cjs/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
  24. package/dist/cjs/advertisement/ble/BleAdvertisement.js +7 -6
  25. package/dist/cjs/advertisement/ble/BleAdvertisement.js.map +1 -1
  26. package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts +11 -10
  27. package/dist/cjs/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
  28. package/dist/cjs/advertisement/ble/BleAdvertiser.js +4 -4
  29. package/dist/cjs/advertisement/ble/BleAdvertiser.js.map +1 -1
  30. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
  31. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js +7 -7
  32. package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
  33. package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts +2 -2
  34. package/dist/cjs/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
  35. package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js +4 -4
  36. package/dist/cjs/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
  37. package/dist/cjs/ble/Ble.d.ts +2 -2
  38. package/dist/cjs/ble/Ble.d.ts.map +1 -1
  39. package/dist/cjs/ble/Ble.js.map +1 -1
  40. package/dist/cjs/ble/BleConsts.d.ts +4 -4
  41. package/dist/cjs/ble/BleConsts.d.ts.map +1 -1
  42. package/dist/cjs/ble/BleConsts.js +7 -7
  43. package/dist/cjs/ble/BleConsts.js.map +1 -1
  44. package/dist/cjs/ble/BtpSessionHandler.js +2 -2
  45. package/dist/cjs/ble/BtpSessionHandler.js.map +1 -1
  46. package/dist/cjs/certificate/AttestationCertificateManager.js +3 -3
  47. package/dist/cjs/certificate/AttestationCertificateManager.js.map +1 -1
  48. package/dist/cjs/certificate/CertificateAuthority.js +2 -2
  49. package/dist/cjs/certificate/CertificateAuthority.js.map +1 -1
  50. package/dist/cjs/certificate/kinds/OperationalBase.js +2 -2
  51. package/dist/cjs/certificate/kinds/OperationalBase.js.map +1 -1
  52. package/dist/cjs/cluster/client/ClusterClient.js +5 -5
  53. package/dist/cjs/cluster/client/ClusterClient.js.map +1 -1
  54. package/dist/cjs/cluster/client/ClusterClientTypes.d.ts +3 -3
  55. package/dist/cjs/cluster/client/ClusterClientTypes.d.ts.map +1 -1
  56. package/dist/cjs/cluster/client/EventClient.d.ts +2 -1
  57. package/dist/cjs/cluster/client/EventClient.d.ts.map +1 -1
  58. package/dist/cjs/cluster/client/EventClient.js +3 -3
  59. package/dist/cjs/cluster/client/EventClient.js.map +1 -1
  60. package/dist/cjs/common/FailsafeContext.d.ts +4 -4
  61. package/dist/cjs/common/FailsafeContext.d.ts.map +1 -1
  62. package/dist/cjs/common/FailsafeContext.js +8 -8
  63. package/dist/cjs/common/FailsafeContext.js.map +1 -1
  64. package/dist/cjs/common/FailsafeTimer.d.ts +3 -3
  65. package/dist/cjs/common/FailsafeTimer.d.ts.map +1 -1
  66. package/dist/cjs/common/FailsafeTimer.js +8 -8
  67. package/dist/cjs/common/FailsafeTimer.js.map +1 -1
  68. package/dist/cjs/common/Scanner.d.ts +7 -7
  69. package/dist/cjs/common/Scanner.d.ts.map +1 -1
  70. package/dist/cjs/common/Scanner.js.map +1 -1
  71. package/dist/cjs/events/OccurrenceManager.js +1 -1
  72. package/dist/cjs/events/OccurrenceManager.js.map +1 -1
  73. package/dist/cjs/groups/FabricGroups.d.ts +1 -1
  74. package/dist/cjs/groups/FabricGroups.js +1 -1
  75. package/dist/cjs/groups/Groups.d.ts +1 -1
  76. package/dist/cjs/groups/KeySets.d.ts +3 -3
  77. package/dist/cjs/groups/KeySets.d.ts.map +1 -1
  78. package/dist/cjs/groups/KeySets.js +12 -4
  79. package/dist/cjs/groups/KeySets.js.map +1 -1
  80. package/dist/cjs/interaction/InteractionClient.d.ts +9 -9
  81. package/dist/cjs/interaction/InteractionClient.d.ts.map +1 -1
  82. package/dist/cjs/interaction/InteractionClient.js +33 -33
  83. package/dist/cjs/interaction/InteractionClient.js.map +1 -1
  84. package/dist/cjs/interaction/InteractionMessenger.d.ts +10 -10
  85. package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
  86. package/dist/cjs/interaction/InteractionMessenger.js +15 -15
  87. package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
  88. package/dist/cjs/interaction/Subscription.d.ts +3 -4
  89. package/dist/cjs/interaction/Subscription.d.ts.map +1 -1
  90. package/dist/cjs/interaction/Subscription.js +9 -12
  91. package/dist/cjs/interaction/Subscription.js.map +1 -1
  92. package/dist/cjs/interaction/SubscriptionClient.d.ts +3 -3
  93. package/dist/cjs/interaction/SubscriptionClient.d.ts.map +1 -1
  94. package/dist/cjs/interaction/SubscriptionClient.js +3 -3
  95. package/dist/cjs/interaction/SubscriptionClient.js.map +1 -1
  96. package/dist/cjs/mdns/MdnsClient.d.ts +9 -9
  97. package/dist/cjs/mdns/MdnsClient.d.ts.map +1 -1
  98. package/dist/cjs/mdns/MdnsClient.js +86 -82
  99. package/dist/cjs/mdns/MdnsClient.js.map +1 -1
  100. package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
  101. package/dist/cjs/mdns/MdnsServer.js +11 -9
  102. package/dist/cjs/mdns/MdnsServer.js.map +1 -1
  103. package/dist/cjs/peer/ControllerCommissioner.d.ts +2 -2
  104. package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
  105. package/dist/cjs/peer/ControllerCommissioner.js +7 -7
  106. package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
  107. package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
  108. package/dist/cjs/peer/ControllerCommissioningFlow.js +37 -35
  109. package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
  110. package/dist/cjs/peer/ControllerDiscovery.d.ts +4 -4
  111. package/dist/cjs/peer/ControllerDiscovery.d.ts.map +1 -1
  112. package/dist/cjs/peer/ControllerDiscovery.js +12 -17
  113. package/dist/cjs/peer/ControllerDiscovery.js.map +1 -1
  114. package/dist/cjs/peer/InteractionQueue.d.ts.map +1 -1
  115. package/dist/cjs/peer/InteractionQueue.js +2 -2
  116. package/dist/cjs/peer/InteractionQueue.js.map +1 -1
  117. package/dist/cjs/peer/PeerSet.d.ts +2 -2
  118. package/dist/cjs/peer/PeerSet.d.ts.map +1 -1
  119. package/dist/cjs/peer/PeerSet.js +25 -25
  120. package/dist/cjs/peer/PeerSet.js.map +1 -1
  121. package/dist/cjs/protocol/DeviceCommissioner.d.ts.map +1 -1
  122. package/dist/cjs/protocol/DeviceCommissioner.js +1 -1
  123. package/dist/cjs/protocol/DeviceCommissioner.js.map +1 -1
  124. package/dist/cjs/protocol/ExchangeManager.d.ts +1 -1
  125. package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
  126. package/dist/cjs/protocol/ExchangeManager.js +2 -5
  127. package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
  128. package/dist/cjs/protocol/ExchangeProvider.d.ts +4 -4
  129. package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
  130. package/dist/cjs/protocol/ExchangeProvider.js +3 -3
  131. package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
  132. package/dist/cjs/protocol/MessageChannel.d.ts +5 -5
  133. package/dist/cjs/protocol/MessageChannel.d.ts.map +1 -1
  134. package/dist/cjs/protocol/MessageChannel.js +19 -15
  135. package/dist/cjs/protocol/MessageChannel.js.map +1 -1
  136. package/dist/cjs/protocol/MessageExchange.d.ts +6 -6
  137. package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
  138. package/dist/cjs/protocol/MessageExchange.js +35 -33
  139. package/dist/cjs/protocol/MessageExchange.js.map +1 -1
  140. package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +8 -8
  141. package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
  142. package/dist/cjs/securechannel/SecureChannelMessenger.js +17 -17
  143. package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
  144. package/dist/cjs/session/InsecureSession.d.ts +2 -2
  145. package/dist/cjs/session/InsecureSession.d.ts.map +1 -1
  146. package/dist/cjs/session/InsecureSession.js.map +1 -1
  147. package/dist/cjs/session/NodeSession.js +3 -3
  148. package/dist/cjs/session/Session.d.ts +7 -7
  149. package/dist/cjs/session/Session.d.ts.map +1 -1
  150. package/dist/cjs/session/Session.js +19 -19
  151. package/dist/cjs/session/Session.js.map +1 -1
  152. package/dist/cjs/session/SessionIntervals.d.ts +7 -6
  153. package/dist/cjs/session/SessionIntervals.d.ts.map +1 -1
  154. package/dist/cjs/session/SessionIntervals.js +8 -8
  155. package/dist/cjs/session/SessionIntervals.js.map +1 -1
  156. package/dist/cjs/session/SessionManager.d.ts +2 -2
  157. package/dist/cjs/session/SessionManager.d.ts.map +1 -1
  158. package/dist/cjs/session/SessionManager.js +6 -6
  159. package/dist/cjs/session/SessionManager.js.map +1 -1
  160. package/dist/cjs/session/case/CaseClient.d.ts +2 -1
  161. package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
  162. package/dist/cjs/session/case/CaseClient.js +2 -2
  163. package/dist/cjs/session/case/CaseClient.js.map +1 -1
  164. package/dist/cjs/session/pase/PaseMessenger.d.ts.map +1 -1
  165. package/dist/cjs/session/pase/PaseMessenger.js +4 -7
  166. package/dist/cjs/session/pase/PaseMessenger.js.map +1 -1
  167. package/dist/cjs/session/pase/PaseServer.d.ts.map +1 -1
  168. package/dist/cjs/session/pase/PaseServer.js +1 -1
  169. package/dist/cjs/session/pase/PaseServer.js.map +1 -1
  170. package/dist/esm/action/Val.d.ts +6 -0
  171. package/dist/esm/action/Val.d.ts.map +1 -1
  172. package/dist/esm/action/Val.js.map +1 -1
  173. package/dist/esm/action/client/ClientInteraction.d.ts +1 -1
  174. package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
  175. package/dist/esm/action/client/ClientInteraction.js +5 -5
  176. package/dist/esm/action/client/ClientInteraction.js.map +1 -1
  177. package/dist/esm/action/client/ClientSubscription.d.ts +2 -1
  178. package/dist/esm/action/client/ClientSubscription.d.ts.map +1 -1
  179. package/dist/esm/action/client/ClientSubscriptionHandler.js +2 -2
  180. package/dist/esm/action/client/ClientSubscriptionHandler.js.map +1 -1
  181. package/dist/esm/action/client/ClientSubscriptions.d.ts.map +1 -1
  182. package/dist/esm/action/client/ClientSubscriptions.js +14 -8
  183. package/dist/esm/action/client/ClientSubscriptions.js.map +1 -1
  184. package/dist/esm/action/request/Subscribe.d.ts +6 -6
  185. package/dist/esm/action/request/Subscribe.d.ts.map +1 -1
  186. package/dist/esm/action/request/Subscribe.js +12 -10
  187. package/dist/esm/action/request/Subscribe.js.map +1 -1
  188. package/dist/esm/advertisement/Advertisement.d.ts +3 -3
  189. package/dist/esm/advertisement/Advertisement.d.ts.map +1 -1
  190. package/dist/esm/advertisement/Advertisement.js +16 -7
  191. package/dist/esm/advertisement/Advertisement.js.map +1 -1
  192. package/dist/esm/advertisement/ble/BleAdvertisement.d.ts.map +1 -1
  193. package/dist/esm/advertisement/ble/BleAdvertisement.js +7 -6
  194. package/dist/esm/advertisement/ble/BleAdvertisement.js.map +1 -1
  195. package/dist/esm/advertisement/ble/BleAdvertiser.d.ts +11 -10
  196. package/dist/esm/advertisement/ble/BleAdvertiser.d.ts.map +1 -1
  197. package/dist/esm/advertisement/ble/BleAdvertiser.js +6 -6
  198. package/dist/esm/advertisement/ble/BleAdvertiser.js.map +1 -1
  199. package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
  200. package/dist/esm/advertisement/mdns/MdnsAdvertisement.js +17 -8
  201. package/dist/esm/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
  202. package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts +2 -2
  203. package/dist/esm/advertisement/mdns/MdnsAdvertiser.d.ts.map +1 -1
  204. package/dist/esm/advertisement/mdns/MdnsAdvertiser.js +14 -6
  205. package/dist/esm/advertisement/mdns/MdnsAdvertiser.js.map +1 -1
  206. package/dist/esm/ble/Ble.d.ts +2 -2
  207. package/dist/esm/ble/Ble.d.ts.map +1 -1
  208. package/dist/esm/ble/Ble.js +5 -1
  209. package/dist/esm/ble/Ble.js.map +1 -1
  210. package/dist/esm/ble/BleConsts.d.ts +4 -4
  211. package/dist/esm/ble/BleConsts.d.ts.map +1 -1
  212. package/dist/esm/ble/BleConsts.js +8 -8
  213. package/dist/esm/ble/BleConsts.js.map +1 -1
  214. package/dist/esm/ble/BtpSessionHandler.js +4 -4
  215. package/dist/esm/ble/BtpSessionHandler.js.map +1 -1
  216. package/dist/esm/certificate/AttestationCertificateManager.js +3 -3
  217. package/dist/esm/certificate/AttestationCertificateManager.js.map +1 -1
  218. package/dist/esm/certificate/CertificateAuthority.js +2 -2
  219. package/dist/esm/certificate/CertificateAuthority.js.map +1 -1
  220. package/dist/esm/certificate/kinds/OperationalBase.js +2 -2
  221. package/dist/esm/certificate/kinds/OperationalBase.js.map +1 -1
  222. package/dist/esm/cluster/client/ClusterClient.js +5 -5
  223. package/dist/esm/cluster/client/ClusterClient.js.map +1 -1
  224. package/dist/esm/cluster/client/ClusterClientTypes.d.ts +3 -3
  225. package/dist/esm/cluster/client/ClusterClientTypes.d.ts.map +1 -1
  226. package/dist/esm/cluster/client/EventClient.d.ts +2 -1
  227. package/dist/esm/cluster/client/EventClient.d.ts.map +1 -1
  228. package/dist/esm/cluster/client/EventClient.js +3 -3
  229. package/dist/esm/cluster/client/EventClient.js.map +1 -1
  230. package/dist/esm/common/FailsafeContext.d.ts +4 -4
  231. package/dist/esm/common/FailsafeContext.d.ts.map +1 -1
  232. package/dist/esm/common/FailsafeContext.js +9 -8
  233. package/dist/esm/common/FailsafeContext.js.map +1 -1
  234. package/dist/esm/common/FailsafeTimer.d.ts +3 -3
  235. package/dist/esm/common/FailsafeTimer.d.ts.map +1 -1
  236. package/dist/esm/common/FailsafeTimer.js +8 -8
  237. package/dist/esm/common/FailsafeTimer.js.map +1 -1
  238. package/dist/esm/common/Scanner.d.ts +7 -7
  239. package/dist/esm/common/Scanner.d.ts.map +1 -1
  240. package/dist/esm/common/Scanner.js +5 -1
  241. package/dist/esm/common/Scanner.js.map +1 -1
  242. package/dist/esm/events/OccurrenceManager.js +1 -1
  243. package/dist/esm/events/OccurrenceManager.js.map +1 -1
  244. package/dist/esm/groups/FabricGroups.d.ts +1 -1
  245. package/dist/esm/groups/FabricGroups.js +1 -1
  246. package/dist/esm/groups/Groups.d.ts +1 -1
  247. package/dist/esm/groups/KeySets.d.ts +3 -3
  248. package/dist/esm/groups/KeySets.d.ts.map +1 -1
  249. package/dist/esm/groups/KeySets.js +13 -5
  250. package/dist/esm/groups/KeySets.js.map +1 -1
  251. package/dist/esm/interaction/InteractionClient.d.ts +9 -9
  252. package/dist/esm/interaction/InteractionClient.d.ts.map +1 -1
  253. package/dist/esm/interaction/InteractionClient.js +34 -33
  254. package/dist/esm/interaction/InteractionClient.js.map +1 -1
  255. package/dist/esm/interaction/InteractionMessenger.d.ts +10 -10
  256. package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
  257. package/dist/esm/interaction/InteractionMessenger.js +16 -15
  258. package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
  259. package/dist/esm/interaction/Subscription.d.ts +3 -4
  260. package/dist/esm/interaction/Subscription.d.ts.map +1 -1
  261. package/dist/esm/interaction/Subscription.js +9 -12
  262. package/dist/esm/interaction/Subscription.js.map +1 -1
  263. package/dist/esm/interaction/SubscriptionClient.d.ts +3 -3
  264. package/dist/esm/interaction/SubscriptionClient.d.ts.map +1 -1
  265. package/dist/esm/interaction/SubscriptionClient.js +4 -4
  266. package/dist/esm/interaction/SubscriptionClient.js.map +1 -1
  267. package/dist/esm/mdns/MdnsClient.d.ts +9 -9
  268. package/dist/esm/mdns/MdnsClient.d.ts.map +1 -1
  269. package/dist/esm/mdns/MdnsClient.js +94 -82
  270. package/dist/esm/mdns/MdnsClient.js.map +1 -1
  271. package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
  272. package/dist/esm/mdns/MdnsServer.js +14 -9
  273. package/dist/esm/mdns/MdnsServer.js.map +1 -1
  274. package/dist/esm/peer/ControllerCommissioner.d.ts +2 -2
  275. package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
  276. package/dist/esm/peer/ControllerCommissioner.js +11 -8
  277. package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
  278. package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
  279. package/dist/esm/peer/ControllerCommissioningFlow.js +44 -35
  280. package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
  281. package/dist/esm/peer/ControllerDiscovery.d.ts +4 -4
  282. package/dist/esm/peer/ControllerDiscovery.d.ts.map +1 -1
  283. package/dist/esm/peer/ControllerDiscovery.js +20 -18
  284. package/dist/esm/peer/ControllerDiscovery.js.map +1 -1
  285. package/dist/esm/peer/InteractionQueue.d.ts.map +1 -1
  286. package/dist/esm/peer/InteractionQueue.js +3 -3
  287. package/dist/esm/peer/InteractionQueue.js.map +1 -1
  288. package/dist/esm/peer/PeerSet.d.ts +2 -2
  289. package/dist/esm/peer/PeerSet.d.ts.map +1 -1
  290. package/dist/esm/peer/PeerSet.js +29 -26
  291. package/dist/esm/peer/PeerSet.js.map +1 -1
  292. package/dist/esm/protocol/DeviceCommissioner.d.ts.map +1 -1
  293. package/dist/esm/protocol/DeviceCommissioner.js +2 -2
  294. package/dist/esm/protocol/DeviceCommissioner.js.map +1 -1
  295. package/dist/esm/protocol/ExchangeManager.d.ts +1 -1
  296. package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
  297. package/dist/esm/protocol/ExchangeManager.js +3 -6
  298. package/dist/esm/protocol/ExchangeManager.js.map +1 -1
  299. package/dist/esm/protocol/ExchangeProvider.d.ts +4 -4
  300. package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
  301. package/dist/esm/protocol/ExchangeProvider.js +4 -4
  302. package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
  303. package/dist/esm/protocol/MessageChannel.d.ts +5 -5
  304. package/dist/esm/protocol/MessageChannel.d.ts.map +1 -1
  305. package/dist/esm/protocol/MessageChannel.js +20 -16
  306. package/dist/esm/protocol/MessageChannel.js.map +1 -1
  307. package/dist/esm/protocol/MessageExchange.d.ts +6 -6
  308. package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
  309. package/dist/esm/protocol/MessageExchange.js +39 -34
  310. package/dist/esm/protocol/MessageExchange.js.map +1 -1
  311. package/dist/esm/securechannel/SecureChannelMessenger.d.ts +8 -8
  312. package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
  313. package/dist/esm/securechannel/SecureChannelMessenger.js +18 -18
  314. package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
  315. package/dist/esm/session/InsecureSession.d.ts +2 -2
  316. package/dist/esm/session/InsecureSession.d.ts.map +1 -1
  317. package/dist/esm/session/InsecureSession.js.map +1 -1
  318. package/dist/esm/session/NodeSession.js +3 -3
  319. package/dist/esm/session/Session.d.ts +7 -7
  320. package/dist/esm/session/Session.d.ts.map +1 -1
  321. package/dist/esm/session/Session.js +27 -20
  322. package/dist/esm/session/Session.js.map +1 -1
  323. package/dist/esm/session/SessionIntervals.d.ts +7 -6
  324. package/dist/esm/session/SessionIntervals.d.ts.map +1 -1
  325. package/dist/esm/session/SessionIntervals.js +8 -8
  326. package/dist/esm/session/SessionIntervals.js.map +1 -1
  327. package/dist/esm/session/SessionManager.d.ts +2 -2
  328. package/dist/esm/session/SessionManager.d.ts.map +1 -1
  329. package/dist/esm/session/SessionManager.js +6 -6
  330. package/dist/esm/session/SessionManager.js.map +1 -1
  331. package/dist/esm/session/case/CaseClient.d.ts +2 -1
  332. package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
  333. package/dist/esm/session/case/CaseClient.js +2 -2
  334. package/dist/esm/session/case/CaseClient.js.map +1 -1
  335. package/dist/esm/session/pase/PaseMessenger.d.ts.map +1 -1
  336. package/dist/esm/session/pase/PaseMessenger.js +5 -11
  337. package/dist/esm/session/pase/PaseMessenger.js.map +1 -1
  338. package/dist/esm/session/pase/PaseServer.d.ts.map +1 -1
  339. package/dist/esm/session/pase/PaseServer.js +2 -1
  340. package/dist/esm/session/pase/PaseServer.js.map +1 -1
  341. package/package.json +6 -6
  342. package/src/action/Val.ts +5 -0
  343. package/src/action/client/ClientInteraction.ts +4 -4
  344. package/src/action/client/ClientSubscription.ts +2 -1
  345. package/src/action/client/ClientSubscriptionHandler.ts +2 -2
  346. package/src/action/client/ClientSubscriptions.ts +14 -8
  347. package/src/action/request/Subscribe.ts +17 -15
  348. package/src/advertisement/Advertisement.ts +18 -8
  349. package/src/advertisement/ble/BleAdvertisement.ts +7 -6
  350. package/src/advertisement/ble/BleAdvertiser.ts +11 -11
  351. package/src/advertisement/mdns/MdnsAdvertisement.ts +20 -9
  352. package/src/advertisement/mdns/MdnsAdvertiser.ts +17 -7
  353. package/src/ble/Ble.ts +11 -2
  354. package/src/ble/BleConsts.ts +5 -5
  355. package/src/ble/BtpSessionHandler.ts +4 -4
  356. package/src/certificate/AttestationCertificateManager.ts +3 -3
  357. package/src/certificate/CertificateAuthority.ts +2 -2
  358. package/src/certificate/kinds/OperationalBase.ts +3 -3
  359. package/src/cluster/client/ClusterClient.ts +8 -8
  360. package/src/cluster/client/ClusterClientTypes.ts +3 -3
  361. package/src/cluster/client/EventClient.ts +5 -5
  362. package/src/common/FailsafeContext.ts +11 -13
  363. package/src/common/FailsafeTimer.ts +11 -13
  364. package/src/common/Scanner.ts +16 -7
  365. package/src/events/OccurrenceManager.ts +1 -1
  366. package/src/groups/FabricGroups.ts +1 -1
  367. package/src/groups/KeySets.ts +14 -6
  368. package/src/interaction/InteractionClient.ts +46 -44
  369. package/src/interaction/InteractionMessenger.ts +24 -22
  370. package/src/interaction/Subscription.ts +10 -14
  371. package/src/interaction/SubscriptionClient.ts +6 -6
  372. package/src/mdns/MdnsClient.ts +105 -82
  373. package/src/mdns/MdnsServer.ts +14 -9
  374. package/src/peer/ControllerCommissioner.ts +12 -9
  375. package/src/peer/ControllerCommissioningFlow.ts +48 -39
  376. package/src/peer/ControllerDiscovery.ts +22 -18
  377. package/src/peer/InteractionQueue.ts +3 -3
  378. package/src/peer/PeerSet.ts +34 -28
  379. package/src/protocol/DeviceCommissioner.ts +2 -2
  380. package/src/protocol/ExchangeManager.ts +3 -6
  381. package/src/protocol/ExchangeProvider.ts +6 -6
  382. package/src/protocol/MessageChannel.ts +26 -21
  383. package/src/protocol/MessageExchange.ts +42 -38
  384. package/src/securechannel/SecureChannelMessenger.ts +16 -22
  385. package/src/session/InsecureSession.ts +2 -2
  386. package/src/session/NodeSession.ts +3 -3
  387. package/src/session/Session.ts +31 -21
  388. package/src/session/SessionIntervals.ts +11 -11
  389. package/src/session/SessionManager.ts +10 -9
  390. package/src/session/case/CaseClient.ts +3 -3
  391. package/src/session/pase/PaseMessenger.ts +5 -11
  392. package/src/session/pase/PaseServer.ts +2 -1
@@ -76,7 +76,7 @@ export class AttestationCertificateManager {
76
76
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
77
77
  // @ts-ignore
78
78
  private async generatePAACert(vendorId?: VendorId) {
79
- const now = Time.get().now();
79
+ const now = Time.now;
80
80
  const cert = new Paa({
81
81
  serialNumber: Bytes.fromHex(toHex(this.paaCertId)),
82
82
  signatureAlgorithm: 1 /* EcdsaWithSHA256 */,
@@ -111,7 +111,7 @@ export class AttestationCertificateManager {
111
111
  }
112
112
 
113
113
  private async generatePAICert(vendorId: VendorId, productId?: number) {
114
- const now = Time.get().now();
114
+ const now = Time.now;
115
115
  const cert = new Pai({
116
116
  serialNumber: Bytes.fromHex(toHex(this.#paiCertId)),
117
117
  signatureAlgorithm: 1 /* EcdsaWithSHA256 */,
@@ -146,7 +146,7 @@ export class AttestationCertificateManager {
146
146
  }
147
147
 
148
148
  async generateDaCert(publicKey: Bytes, vendorId: VendorId, productId: number) {
149
- const now = Time.get().now();
149
+ const now = Time.now;
150
150
  const certId = this.#nextCertificateId++;
151
151
  const cert = new Dac({
152
152
  serialNumber: Bytes.fromHex(toHex(certId)),
@@ -117,7 +117,7 @@ export class CertificateAuthority {
117
117
  }
118
118
 
119
119
  async #generateRootCert() {
120
- const now = Time.get().now();
120
+ const now = Time.now;
121
121
  const cert = new Rcac({
122
122
  serialNumber: Bytes.fromHex(toHex(this.#rootCertId)),
123
123
  signatureAlgorithm: 1 /* EcdsaWithSHA256 */,
@@ -148,7 +148,7 @@ export class CertificateAuthority {
148
148
  nodeId: NodeId,
149
149
  caseAuthenticatedTags?: CaseAuthenticatedTag[],
150
150
  ) {
151
- const now = Time.get().now();
151
+ const now = Time.now;
152
152
  const certId = this.#nextCertificateId++;
153
153
  const cert = new Noc({
154
154
  serialNumber: Bytes.fromHex(toHex(certId)),
@@ -62,10 +62,10 @@ export abstract class OperationalBase<CT extends X509Certificate> extends X509Ba
62
62
 
63
63
  // notBefore date should be already reached, notAfter is not checked right now
64
64
  // TODO: implement real checks when we add "Last known Good UTC time"
65
- if (cert.notBefore * 1000 > Time.nowMs()) {
66
- logger.warn(`Certificate notBefore date is in the future: ${cert.notBefore * 1000} vs ${Time.nowMs()}`);
65
+ if (cert.notBefore * 1000 > Time.nowMs) {
66
+ logger.warn(`Certificate notBefore date is in the future: ${cert.notBefore * 1000} vs ${Time.nowMs}`);
67
67
  /*throw new CertificateError(
68
- `Certificate notBefore date is in the future: ${cert.notBefore * 1000} vs ${Time.nowMs()}`,
68
+ `Certificate notBefore date is in the future: ${cert.notBefore * 1000} vs ${Time.nowMs}`,
69
69
  );*/
70
70
  }
71
71
  }
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { capitalize, Diagnostic, ImplementationError, Logger, Merge } from "#general";
7
+ import { capitalize, Diagnostic, Duration, ImplementationError, Logger, Merge } from "#general";
8
8
  import {
9
9
  Attribute,
10
10
  AttributeId,
@@ -387,16 +387,16 @@ export function ClusterClient<const T extends ClusterType>(
387
387
  request: RequestT,
388
388
  options: {
389
389
  asTimedRequest?: boolean;
390
- timedRequestTimeoutMs?: number;
391
- expectedProcessingTimeMs?: number;
390
+ timedRequestTimeout?: Duration;
391
+ expectedProcessingTime?: Duration;
392
392
  useExtendedFailSafeMessageResponseTimeout?: boolean;
393
393
  } = {},
394
394
  ) => {
395
395
  const {
396
396
  asTimedRequest,
397
- timedRequestTimeoutMs,
397
+ timedRequestTimeout,
398
398
  useExtendedFailSafeMessageResponseTimeout,
399
- expectedProcessingTimeMs,
399
+ expectedProcessingTime,
400
400
  } = options;
401
401
  if (isGroupAddress) {
402
402
  return interactionClient.invokeWithSuppressedResponse<Command<RequestT, ResponseT, any>>({
@@ -404,7 +404,7 @@ export function ClusterClient<const T extends ClusterType>(
404
404
  command: commandDef[commandName],
405
405
  request,
406
406
  asTimedRequest,
407
- timedRequestTimeoutMs,
407
+ timedRequestTimeout,
408
408
  });
409
409
  }
410
410
  return interactionClient.invoke<Command<RequestT, ResponseT, any>>({
@@ -413,8 +413,8 @@ export function ClusterClient<const T extends ClusterType>(
413
413
  command: commandDef[commandName],
414
414
  request,
415
415
  asTimedRequest,
416
- timedRequestTimeoutMs,
417
- expectedProcessingTimeMs,
416
+ timedRequestTimeout,
417
+ expectedProcessingTime,
418
418
  useExtendedFailSafeMessageResponseTimeout,
419
419
  });
420
420
  };
@@ -3,7 +3,7 @@
3
3
  * Copyright 2022-2025 Matter.js Authors
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { Merge } from "#general";
6
+ import { Duration, Merge } from "#general";
7
7
  import {
8
8
  Attribute,
9
9
  AttributeId,
@@ -63,13 +63,13 @@ export type SignatureFromCommandSpec<C extends Command<any, any, any>> = (
63
63
  asTimedRequest?: boolean;
64
64
 
65
65
  /** Override the request timeout when the command is sent as times request. Default are 10s. */
66
- timedRequestTimeoutMs?: number;
66
+ timedRequestTimeout?: Duration;
67
67
 
68
68
  /**
69
69
  * Expected processing time on the device side for this command.
70
70
  * useExtendedFailSafeMessageResponseTimeout is ignored if this value is set.
71
71
  */
72
- expectedProcessingTimeMs?: number;
72
+ expectedProcessingTime?: Duration;
73
73
 
74
74
  /**
75
75
  * Use the extended fail-safe message response timeout of 30 seconds. Use this for all commands
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { ImplementationError } from "#general";
7
+ import { Duration, ImplementationError } from "#general";
8
8
  import { ClusterId, EndpointNumber, Event, EventId, EventNumber } from "#types";
9
9
  import { DecodedEventData } from "../../interaction/EventDataDecoder.js";
10
10
  import { InteractionClient } from "../../interaction/InteractionClient.js";
@@ -58,8 +58,8 @@ export class EventClient<T> {
58
58
  }
59
59
 
60
60
  async subscribe(
61
- minIntervalFloorSeconds: number,
62
- maxIntervalCeilingSeconds: number,
61
+ minIntervalFloor: Duration,
62
+ maxIntervalCeiling: Duration,
63
63
  isUrgent = true,
64
64
  minimumEventNumber?: EventNumber,
65
65
  isFabricFiltered?: boolean,
@@ -71,8 +71,8 @@ export class EventClient<T> {
71
71
  endpointId: this.endpointId,
72
72
  clusterId: this.clusterId,
73
73
  event: this.event,
74
- minIntervalFloorSeconds,
75
- maxIntervalCeilingSeconds,
74
+ minIntervalFloor,
75
+ maxIntervalCeiling,
76
76
  isUrgent,
77
77
  minimumEventNumber,
78
78
  isFabricFiltered,
@@ -8,6 +8,7 @@ import {
8
8
  AsyncObservable,
9
9
  Bytes,
10
10
  Construction,
11
+ Duration,
11
12
  Logger,
12
13
  MatterFlowError,
13
14
  UnexpectedDataError,
@@ -46,7 +47,7 @@ export abstract class FailsafeContext {
46
47
  #commissioned = AsyncObservable<[], void>();
47
48
 
48
49
  constructor(options: FailsafeContext.Options) {
49
- const { expiryLengthSeconds, associatedFabric, maxCumulativeFailsafeSeconds } = options;
50
+ const { expiryLength, associatedFabric, maxCumulativeFailsafe } = options;
50
51
 
51
52
  this.#sessions = options.sessions;
52
53
  this.#fabrics = options.fabrics;
@@ -61,21 +62,18 @@ export abstract class FailsafeContext {
61
62
 
62
63
  // If ExpiryLengthSeconds is non-zero and the fail-safe timer was not currently armed, then the fail-safe
63
64
  // timer SHALL be armed for that duration.
64
- this.#failsafe = new FailsafeTimer(
65
- associatedFabric,
66
- expiryLengthSeconds,
67
- maxCumulativeFailsafeSeconds,
68
- () => this.#failSafeExpired(),
65
+ this.#failsafe = new FailsafeTimer(associatedFabric, expiryLength, maxCumulativeFailsafe, () =>
66
+ this.#failSafeExpired(),
69
67
  );
70
- logger.debug(`Arm failSafe timer for ${expiryLengthSeconds}s.`);
68
+ logger.debug(`Arm failSafe timer for ${Duration.format(expiryLength)}`);
71
69
  });
72
70
  }
73
71
 
74
- async extend(fabric: Fabric | undefined, expiryLengthSeconds: number) {
72
+ async extend(fabric: Fabric | undefined, expiryLength: Duration) {
75
73
  await this.#construction;
76
- await this.#failsafe?.reArm(fabric, expiryLengthSeconds);
77
- if (expiryLengthSeconds > 0) {
78
- logger.debug(`Extend failSafe timer for ${expiryLengthSeconds}s.`);
74
+ await this.#failsafe?.reArm(fabric, expiryLength);
75
+ if (expiryLength > 0) {
76
+ logger.debug(`Extend failSafe timer for ${Duration.format(expiryLength)}`);
79
77
  }
80
78
  }
81
79
 
@@ -341,8 +339,8 @@ export namespace FailsafeContext {
341
339
  export interface Options {
342
340
  sessions: SessionManager;
343
341
  fabrics: FabricManager;
344
- expiryLengthSeconds: number;
345
- maxCumulativeFailsafeSeconds: number;
342
+ expiryLength: Duration;
343
+ maxCumulativeFailsafe: Duration;
346
344
  associatedFabric: Fabric | undefined;
347
345
  }
348
346
  }
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { Logger, MatterFlowError, Time, Timer } from "#general";
7
+ import { Duration, Logger, MatterFlowError, Time, Timer } from "#general";
8
8
  import { Fabric } from "../fabric/Fabric.js";
9
9
  import type { FailsafeContext } from "./FailsafeContext.js";
10
10
 
@@ -22,16 +22,14 @@ export class FailsafeTimer {
22
22
 
23
23
  constructor(
24
24
  public associatedFabric: Fabric | undefined,
25
- expiryLengthSeconds: number,
26
- maxCumulativeFailsafeSeconds: number,
25
+ expiryLength: Duration,
26
+ maxCumulativeFailsafe: Duration,
27
27
  expiryCallback: () => Promise<void>,
28
28
  ) {
29
29
  this.#expiryCallback = expiryCallback;
30
- this.#failsafeTimer = this.#startFailsafeTimer(expiryLengthSeconds);
31
- this.#maxCumulativeFailsafeTimer = Time.getTimer(
32
- "Max cumulative failsafe",
33
- maxCumulativeFailsafeSeconds * 1000,
34
- () => this.expire(),
30
+ this.#failsafeTimer = this.#startFailsafeTimer(expiryLength);
31
+ this.#maxCumulativeFailsafeTimer = Time.getTimer("Max cumulative failsafe", maxCumulativeFailsafe, () =>
32
+ this.expire(),
35
33
  ).start();
36
34
  }
37
35
 
@@ -45,7 +43,7 @@ export class FailsafeTimer {
45
43
  }
46
44
 
47
45
  /** Handle "Re-Arming" an existing FailSafe context to extend the timer, expire or fail if not allowed. */
48
- async reArm(associatedFabric: Fabric | undefined, expiryLengthSeconds: number) {
46
+ async reArm(associatedFabric: Fabric | undefined, expiry: Duration) {
49
47
  if (!this.#failsafeTimer.isRunning) {
50
48
  throw new MatterFlowError("FailSafe already expired.");
51
49
  }
@@ -58,7 +56,7 @@ export class FailsafeTimer {
58
56
 
59
57
  this.#failsafeTimer.stop();
60
58
 
61
- if (expiryLengthSeconds === 0) {
59
+ if (expiry === 0) {
62
60
  // If ExpiryLengthSeconds is 0 and the fail-safe timer was already armed and the accessing fabric matches
63
61
  // the Fabric currently associated with the fail-safe context, then the fail-safe timer SHALL be
64
62
  // immediately expired (see further below for side-effects of expiration).
@@ -67,7 +65,7 @@ export class FailsafeTimer {
67
65
  // If ExpiryLengthSeconds is non-zero and the fail-safe timer was currently armed, and the accessing Fabric
68
66
  // matches the fail-safe context’s associated Fabric, then the fail-safe timer SHALL be re- armed to expire
69
67
  // in ExpiryLengthSeconds.
70
- this.#failsafeTimer = this.#startFailsafeTimer(expiryLengthSeconds);
68
+ this.#failsafeTimer = this.#startFailsafeTimer(expiry);
71
69
  }
72
70
  }
73
71
 
@@ -83,8 +81,8 @@ export class FailsafeTimer {
83
81
  this.#maxCumulativeFailsafeTimer.stop();
84
82
  }
85
83
 
86
- #startFailsafeTimer(expiryLengthSeconds: number) {
87
- return Time.getTimer("Failsafe expiration", expiryLengthSeconds * 1000, () =>
84
+ #startFailsafeTimer(expiry: Duration) {
85
+ return Time.getTimer("Failsafe expiration", expiry, () =>
88
86
  this.expire().catch(e => logger.error("Error during failsafe expiration", e)),
89
87
  ).start();
90
88
  }
@@ -4,7 +4,16 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- import { BasicSet, ChannelType, Environment, Environmental, Lifespan, ServerAddress, ServerAddressIp } from "#general";
7
+ import {
8
+ BasicSet,
9
+ ChannelType,
10
+ Duration,
11
+ Environment,
12
+ Environmental,
13
+ Lifespan,
14
+ ServerAddress,
15
+ ServerAddressIp,
16
+ } from "#general";
8
17
  import { DiscoveryCapabilitiesBitmap, NodeId, TypeFromPartialBitSchema, VendorId } from "#types";
9
18
  import { Fabric } from "../fabric/Fabric.js";
10
19
 
@@ -32,13 +41,13 @@ export type DiscoveryData = {
32
41
  PI?: string;
33
42
 
34
43
  /** Sleep Idle Interval */
35
- SII?: number;
44
+ SII?: Duration;
36
45
 
37
46
  /** Sleep Active Interval */
38
- SAI?: number;
47
+ SAI?: Duration;
39
48
 
40
49
  /** Session active threshold */
41
- SAT?: number;
50
+ SAT?: Duration;
42
51
 
43
52
  /** TCP supported */
44
53
  T?: number; // SupportedTransportsBitmap but comes in as number, so converted on usage
@@ -116,7 +125,7 @@ export interface Scanner {
116
125
  findOperationalDevice(
117
126
  fabric: Fabric,
118
127
  nodeId: NodeId,
119
- timeoutSeconds?: number,
128
+ timeout?: Duration,
120
129
  ignoreExistingRecords?: boolean,
121
130
  ): Promise<OperationalDevice | undefined>;
122
131
 
@@ -132,7 +141,7 @@ export interface Scanner {
132
141
  */
133
142
  findCommissionableDevices(
134
143
  identifier: CommissionableDeviceIdentifiers,
135
- timeoutSeconds?: number,
144
+ timeout?: Duration,
136
145
  ignoreExistingRecords?: boolean,
137
146
  ): Promise<CommissionableDevice[]>;
138
147
 
@@ -144,7 +153,7 @@ export interface Scanner {
144
153
  findCommissionableDevicesContinuously(
145
154
  identifier: CommissionableDeviceIdentifiers,
146
155
  callback: (device: CommissionableDevice) => void,
147
- timeoutSeconds?: number,
156
+ timeout?: Duration,
148
157
  cancelSignal?: Promise<void>,
149
158
  ): Promise<CommissionableDevice[]>;
150
159
 
@@ -277,7 +277,7 @@ export class OccurrenceManager {
277
277
 
278
278
  add(occurrence: Occurrence): MaybePromise<NumberedOccurrence> {
279
279
  return MaybePromise.then(this.#store.add(occurrence), entry => {
280
- logger.debug(`Recorded event #${entry.number}: ${Diagnostic.json(occurrence)}`);
280
+ logger.debug(`Recorded event #${entry.number}`, Diagnostic.dict(occurrence));
281
281
  this.#occurrences.push(entry);
282
282
  if (this.#occurrences.length > this.#bufferConfig.maxEventAllowance) {
283
283
  this.#startCull();
@@ -96,7 +96,7 @@ export class FabricGroups {
96
96
 
97
97
  /*
98
98
  TODO for Controller to generate new epochs
99
- addGroupEpoch(groupKeySetId: number, startTimeMs = Time.nowMs()) {
99
+ addGroupEpoch(groupKeySetId: number, startTimeMs = Time.nowMs) {
100
100
  // TODO for Controller to generate new epochs
101
101
  const epochKey = Crypto.getRandomData(CRYPTO_SYMMETRIC_KEY_LENGTH);
102
102
  const operationalEpochKey = Crypto.hkdf(epochKey, this.#fabric.operationalId, GROUP_SECURITY_INFO);
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import type { GroupKeyManagement } from "#clusters/group-key-management";
8
- import { BasicSet, Bytes, Crypto, DataReader, ImplementationError, MatterFlowError, Time } from "#general";
8
+ import { BasicSet, Bytes, Crypto, DataReader, ImplementationError, MatterFlowError, Time, Timestamp } from "#general";
9
9
 
10
10
  export const GROUP_KEY_INFO = Bytes.fromString("GroupKeyHash");
11
11
 
@@ -44,7 +44,7 @@ export class KeySets<T extends OperationalKeySet> extends BasicSet<T> {
44
44
  if (groupKeySet === undefined) {
45
45
  throw new MatterFlowError(`GroupKeySet for groupKeySet ${keySetId} not found.`);
46
46
  }
47
- const operationalKeys = Array<{ key: Bytes; sessionId?: number; startTime: number | bigint }>();
47
+ const operationalKeys = Array<{ key: Bytes; sessionId?: number; startTime: Timestamp }>();
48
48
  const {
49
49
  operationalEpochKey0,
50
50
  groupSessionId0,
@@ -63,13 +63,21 @@ export class KeySets<T extends OperationalKeySet> extends BasicSet<T> {
63
63
  operationalKeys.push({
64
64
  key: operationalEpochKey0,
65
65
  sessionId: groupSessionId0 !== null ? groupSessionId0 : undefined,
66
- startTime: epochStartTime0,
66
+ startTime: Timestamp.fromMicroseconds(epochStartTime0),
67
67
  });
68
68
  if (operationalEpochKey1 !== null && groupSessionId1 !== null && epochStartTime1 !== null) {
69
- operationalKeys.push({ key: operationalEpochKey1, sessionId: groupSessionId1, startTime: epochStartTime1 });
69
+ operationalKeys.push({
70
+ key: operationalEpochKey1,
71
+ sessionId: groupSessionId1,
72
+ startTime: Timestamp.fromMicroseconds(epochStartTime1),
73
+ });
70
74
  }
71
75
  if (operationalEpochKey2 !== null && groupSessionId2 !== null && epochStartTime2 !== null) {
72
- operationalKeys.push({ key: operationalEpochKey2, sessionId: groupSessionId2, startTime: epochStartTime2 });
76
+ operationalKeys.push({
77
+ key: operationalEpochKey2,
78
+ sessionId: groupSessionId2,
79
+ startTime: Timestamp.fromMicroseconds(epochStartTime2),
80
+ });
73
81
  }
74
82
  return operationalKeys;
75
83
  }
@@ -96,7 +104,7 @@ export class KeySets<T extends OperationalKeySet> extends BasicSet<T> {
96
104
  // epoch key (specifically, the epoch key with the latest start time that is not in the future).
97
105
  // TODO Nodes that cannot reliably keep track of time calculate the current epoch key as described in
98
106
  // Section 4.17.3.4, “Epoch Key Rotation without Time Synchronization”.
99
- const now = Time.nowUs();
107
+ const now = Time.nowUs;
100
108
  const relevantKeys = operationalKeys.filter(({ startTime }) => startTime <= now);
101
109
  if (relevantKeys.length === 0) {
102
110
  throw new ImplementationError(