@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 CHANGED
@@ -2340,6 +2340,23 @@ var _TinyCloudNode = class _TinyCloudNode {
2340
2340
  transport,
2341
2341
  node: {
2342
2342
  fetchByNetworkId: (networkId) => this.getEncryptionNetwork(networkId)
2343
+ },
2344
+ wellKnown: {
2345
+ fetchWellKnown: async (principal, discoveryKey) => {
2346
+ if (!this._address || principal !== this.did) {
2347
+ return null;
2348
+ }
2349
+ if (!this.config.host) {
2350
+ return null;
2351
+ }
2352
+ const publicSpaceId = (0, import_sdk_core6.makePublicSpaceId)(this._address, this._chainId);
2353
+ const result = await import_sdk_core6.TinyCloud.readPublicSpace(this.config.host, publicSpaceId, discoveryKey);
2354
+ if (!result.ok) {
2355
+ return null;
2356
+ }
2357
+ const body = result.data;
2358
+ return "descriptor" in body && body.descriptor ? body.descriptor : body;
2359
+ }
2343
2360
  }
2344
2361
  });
2345
2362
  }