@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/index.js
CHANGED
|
@@ -19328,6 +19328,23 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
19328
19328
|
transport,
|
|
19329
19329
|
node: {
|
|
19330
19330
|
fetchByNetworkId: (networkId) => this.getEncryptionNetwork(networkId)
|
|
19331
|
+
},
|
|
19332
|
+
wellKnown: {
|
|
19333
|
+
fetchWellKnown: async (principal, discoveryKey) => {
|
|
19334
|
+
if (!this._address || principal !== this.did) {
|
|
19335
|
+
return null;
|
|
19336
|
+
}
|
|
19337
|
+
if (!this.config.host) {
|
|
19338
|
+
return null;
|
|
19339
|
+
}
|
|
19340
|
+
const publicSpaceId = makePublicSpaceId(this._address, this._chainId);
|
|
19341
|
+
const result = await TinyCloud.readPublicSpace(this.config.host, publicSpaceId, discoveryKey);
|
|
19342
|
+
if (!result.ok) {
|
|
19343
|
+
return null;
|
|
19344
|
+
}
|
|
19345
|
+
const body = result.data;
|
|
19346
|
+
return "descriptor" in body && body.descriptor ? body.descriptor : body;
|
|
19347
|
+
}
|
|
19331
19348
|
}
|
|
19332
19349
|
});
|
|
19333
19350
|
}
|