@tinycloud/node-sdk 2.2.0 → 2.2.1-beta.0
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.
- package/dist/core.cjs +17 -0
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +17 -0
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +17 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/core.js
CHANGED
|
@@ -2302,6 +2302,23 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
2302
2302
|
transport,
|
|
2303
2303
|
node: {
|
|
2304
2304
|
fetchByNetworkId: (networkId) => this.getEncryptionNetwork(networkId)
|
|
2305
|
+
},
|
|
2306
|
+
wellKnown: {
|
|
2307
|
+
fetchWellKnown: async (principal, discoveryKey) => {
|
|
2308
|
+
if (!this._address || principal !== this.did) {
|
|
2309
|
+
return null;
|
|
2310
|
+
}
|
|
2311
|
+
if (!this.config.host) {
|
|
2312
|
+
return null;
|
|
2313
|
+
}
|
|
2314
|
+
const publicSpaceId = makePublicSpaceId(this._address, this._chainId);
|
|
2315
|
+
const result = await TinyCloud.readPublicSpace(this.config.host, publicSpaceId, discoveryKey);
|
|
2316
|
+
if (!result.ok) {
|
|
2317
|
+
return null;
|
|
2318
|
+
}
|
|
2319
|
+
const body = result.data;
|
|
2320
|
+
return "descriptor" in body && body.descriptor ? body.descriptor : body;
|
|
2321
|
+
}
|
|
2305
2322
|
}
|
|
2306
2323
|
});
|
|
2307
2324
|
}
|