@gholl-studio/pier-connector 0.2.32 → 0.2.34
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/package.json +2 -2
- package/src/index.js +7 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gholl-studio/pier-connector",
|
|
3
3
|
"author": "gholl",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.34",
|
|
5
5
|
"description": "OpenClaw plugin that connects to the Pier job marketplace. Automatically fetches, executes, and reports distributed tasks for rewards.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
],
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@gholl-studio/pier-sdk": "^1.0.
|
|
37
|
+
"@gholl-studio/pier-sdk": "^1.0.2",
|
|
38
38
|
"@nats-io/jetstream": "^3.3.1",
|
|
39
39
|
"@nats-io/transport-node": "^3.0.0",
|
|
40
40
|
"ethers": "^6.16.0",
|
package/src/index.js
CHANGED
|
@@ -469,8 +469,12 @@ export default function register(api) {
|
|
|
469
469
|
if (!this.config.nodeId && this.config.privateKey) await this.autoRegister();
|
|
470
470
|
const natsConfig = await this.heartbeat();
|
|
471
471
|
if (!natsConfig) throw new Error('No NATS config');
|
|
472
|
-
|
|
473
|
-
|
|
472
|
+
if (natsConfig.url) {
|
|
473
|
+
// Update SDK NATS client with latest URL from heartbeat
|
|
474
|
+
this.client.nats.url = natsConfig.url;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
this.nc = await this.client.connectNats();
|
|
474
478
|
this.js = jetstream(this.nc);
|
|
475
479
|
this.jsm = await jetstreamManager(this.nc);
|
|
476
480
|
this.connectionStatus = 'connected';
|
|
@@ -492,7 +496,7 @@ export default function register(api) {
|
|
|
492
496
|
|
|
493
497
|
async stop() {
|
|
494
498
|
if (this.heartbeatTimer) clearInterval(this.heartbeatTimer);
|
|
495
|
-
if (this.nc) await
|
|
499
|
+
if (this.nc) await this.client.drainNats();
|
|
496
500
|
this.connectionStatus = 'disconnected';
|
|
497
501
|
}
|
|
498
502
|
}
|