@olane/o-node 0.7.58 → 0.7.59

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.
@@ -1 +1 @@
1
- {"version":3,"file":"o-node.transport.d.ts","sourceRoot":"","sources":["../../../src/router/o-node.transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,qBAAa,cAAe,SAAQ,UAAU;IAC5C,SAAgB,IAAI,EAAE,aAAa,CAAwB;IACpD,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;gBAErB,KAAK,EAAE,SAAS,GAAG,MAAM;IAKrC,WAAW,IAAI,SAAS;IAIxB,QAAQ,IAAI,MAAM;IAIlB,QAAQ,IAAI,MAAM;CAOnB"}
1
+ {"version":3,"file":"o-node.transport.d.ts","sourceRoot":"","sources":["../../../src/router/o-node.transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE1D,qBAAa,cAAe,SAAQ,UAAU;IAC5C,SAAgB,IAAI,EAAE,aAAa,CAAwB;IACpD,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;gBAErB,KAAK,EAAE,SAAS,GAAG,MAAM;IAKrC,WAAW,IAAI,SAAS;IAIxB,QAAQ,IAAI,MAAM;IAKlB,QAAQ,IAAI,MAAM;CAQnB"}
@@ -12,11 +12,13 @@ export class oNodeTransport extends oTransport {
12
12
  toString() {
13
13
  return this.value.toString();
14
14
  }
15
+ // TODO: improve this to account for all variations of transport values from libp2p
15
16
  toPeerId() {
16
- const peerId = this.value.toString().split('/p2p/')[1];
17
- if (peerId?.indexOf('/') > -1) {
18
- return peerId.split('/')[0]; // bandaid
17
+ // handle relayed addresses
18
+ if (this.value.toString()?.indexOf('/p2p-circuit') > -1) {
19
+ return this.value.toString().split('/p2p-circuit/p2p/')[1];
19
20
  }
21
+ const peerId = this.value.toString().split('/p2p/')[1];
20
22
  return peerId;
21
23
  }
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olane/o-node",
3
- "version": "0.7.58",
3
+ "version": "0.7.59",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@eslint/eslintrc": "^3.3.1",
42
42
  "@eslint/js": "^9.29.0",
43
- "@olane/o-test": "0.7.58",
43
+ "@olane/o-test": "0.7.59",
44
44
  "@tsconfig/node20": "^20.1.6",
45
45
  "@types/jest": "^30.0.0",
46
46
  "@types/json5": "^2.2.0",
@@ -60,13 +60,13 @@
60
60
  "typescript": "5.4.5"
61
61
  },
62
62
  "dependencies": {
63
- "@olane/o-config": "0.7.58",
64
- "@olane/o-core": "0.7.58",
65
- "@olane/o-protocol": "0.7.58",
66
- "@olane/o-tool": "0.7.58",
63
+ "@olane/o-config": "0.7.59",
64
+ "@olane/o-core": "0.7.59",
65
+ "@olane/o-protocol": "0.7.59",
66
+ "@olane/o-tool": "0.7.59",
67
67
  "debug": "^4.4.1",
68
68
  "dotenv": "^16.5.0",
69
69
  "json5": "^2.2.3"
70
70
  },
71
- "gitHead": "3b5514da4cd69b983eceb596a7b64c60267e07b4"
71
+ "gitHead": "547d0f42df724e748b170813f446793a3ca0eaaa"
72
72
  }