Compare commits

..

3 Commits

Author SHA1 Message Date
semantic-release-bot 8e1dee22b4 chore(release): 0.1.0-develop.22 [skip ci]
# [0.1.0-develop.22](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.21...v0.1.0-develop.22) (2023-09-01)

### Features

* port listen method ([a75c57b](a75c57b1e8))
2023-09-01 12:03:19 +00:00
Derrick Hammer 04c388248c
Merge remote-tracking branch 'origin/develop' into develop 2023-09-01 08:02:26 -04:00
Derrick Hammer a75c57b1e8
feat: port listen method 2023-09-01 08:02:05 -04:00
4 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.22](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.21...v0.1.0-develop.22) (2023-09-01)
### Features
* port listen method ([a75c57b](https://git.lumeweb.com/LumeWeb/libs5/commit/a75c57b1e826a9f26fe25ec10873c0be81f7be5a))
# [0.1.0-develop.21](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.20...v0.1.0-develop.21) (2023-09-01) # [0.1.0-develop.21](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.20...v0.1.0-develop.21) (2023-09-01)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.21", "version": "0.1.0-develop.22",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.21", "version": "0.1.0-develop.22",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.21", "version": "0.1.0-develop.22",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -209,6 +209,15 @@ export class RegistryService {
return null; return null;
} }
public listen(pk: Uint8Array): EventEmitter {
const key = new Multihash(pk).toString();
if (!this.streams[key]) {
this.streams[key] = new EventEmitter();
this.sendRegistryRequest(pk);
}
return this.streams[key];
}
public deserializeRegistryEntry(event: Uint8Array): SignedRegistryEntry { public deserializeRegistryEntry(event: Uint8Array): SignedRegistryEntry {
const dataLength = event[42]; const dataLength = event[42];
return { return {