solana-traderclaw 1.0.102 → 1.0.103
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/{chunk-JVQNXWBW.js → chunk-KNJVODJC.js} +1 -1
- package/dist/{chunk-VVEKPKW3.js → chunk-OXQX7Y2B.js} +3 -3
- package/dist/index.js +20 -8
- package/dist/src/alpha-ws.js +1 -1
- package/dist/src/session-manager.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/solana-trader/SKILL.md +3 -3
|
@@ -163,7 +163,7 @@ var AlphaStreamManager = class {
|
|
|
163
163
|
this.log("info", `Connecting to alpha stream: ${this.config.wsUrl}`);
|
|
164
164
|
return new Promise((resolve, reject) => {
|
|
165
165
|
try {
|
|
166
|
-
this.ws = new WebSocket(url);
|
|
166
|
+
this.ws = new WebSocket(url, { perMessageDeflate: false, handshakeTimeout: 1e4 });
|
|
167
167
|
} catch (err) {
|
|
168
168
|
reject(err);
|
|
169
169
|
return;
|
|
@@ -346,7 +346,7 @@ var SessionManager = class {
|
|
|
346
346
|
const walletPrivateKey = (await this.walletPrivateKeyProvider?.())?.trim();
|
|
347
347
|
if (!walletPrivateKey) {
|
|
348
348
|
throw new Error(
|
|
349
|
-
`Wallet proof required but no
|
|
349
|
+
`Wallet proof required but the gateway cannot sign interactively \u2014 no wallet key is wired into this process. This account already has a wallet. On the host that runs OpenClaw (with a normal terminal / TTY), run: traderclaw login \u2014 complete wallet proof when prompted \u2014 then openclaw gateway restart. That persists new session tokens without putting a private key in the gateway configuration. Do not paste private keys into openclaw.json. Troubleshooting: ${TRADERCLAW_SESSION_TROUBLESHOOTING}`
|
|
350
350
|
);
|
|
351
351
|
}
|
|
352
352
|
walletPubKey = challenge.walletPublicKey || this.walletPublicKey || void 0;
|
|
@@ -376,7 +376,7 @@ var SessionManager = class {
|
|
|
376
376
|
await this.unifiedRefresh();
|
|
377
377
|
if (!this.accessToken) {
|
|
378
378
|
throw new Error(
|
|
379
|
-
`Session expired and could not be refreshed. Re-authentication required. Troubleshooting: ${TRADERCLAW_SESSION_TROUBLESHOOTING}`
|
|
379
|
+
`Session expired and could not be refreshed. Re-authentication required. On the gateway host try: traderclaw login \u2014 then openclaw gateway restart. Troubleshooting: ${TRADERCLAW_SESSION_TROUBLESHOOTING}`
|
|
380
380
|
);
|
|
381
381
|
}
|
|
382
382
|
return this.accessToken;
|
|
@@ -387,7 +387,7 @@ var SessionManager = class {
|
|
|
387
387
|
await this.unifiedRefresh();
|
|
388
388
|
if (!this.accessToken) {
|
|
389
389
|
throw new Error(
|
|
390
|
-
`Session expired and could not be refreshed. Re-authentication required. Troubleshooting: ${TRADERCLAW_SESSION_TROUBLESHOOTING}`
|
|
390
|
+
`Session expired and could not be refreshed. Re-authentication required. On the gateway host try: traderclaw login \u2014 then openclaw gateway restart. Troubleshooting: ${TRADERCLAW_SESSION_TROUBLESHOOTING}`
|
|
391
391
|
);
|
|
392
392
|
}
|
|
393
393
|
return this.accessToken;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-SBYHSJLU.js";
|
|
4
4
|
import {
|
|
5
5
|
SessionManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OXQX7Y2B.js";
|
|
7
7
|
import {
|
|
8
8
|
looksLikeTelegramChatId,
|
|
9
9
|
resolveTelegramRecipientToChatId
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-3UQIQJPQ.js";
|
|
19
19
|
import {
|
|
20
20
|
AlphaStreamManager
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KNJVODJC.js";
|
|
22
22
|
import {
|
|
23
23
|
BitqueryStreamManager
|
|
24
24
|
} from "./chunk-S2DLZKMQ.js";
|
|
@@ -771,6 +771,18 @@ function registerWebFetchTool(api, Type2, logPrefix, options) {
|
|
|
771
771
|
}
|
|
772
772
|
|
|
773
773
|
// index.ts
|
|
774
|
+
var TRADERCLAW_WALLET_PRIVATE_KEY_ENV = "TRADERCLAW_WALLET_PRIVATE_KEY";
|
|
775
|
+
function walletPrivateKeyFromPluginConfigRecord(obj) {
|
|
776
|
+
const w = typeof obj.walletPrivateKey === "string" ? obj.walletPrivateKey.trim() : "";
|
|
777
|
+
return w.length > 0 ? w : void 0;
|
|
778
|
+
}
|
|
779
|
+
function resolveEffectiveWalletPrivateKey(walletPrivateKeyFromPluginConfig) {
|
|
780
|
+
if (walletPrivateKeyFromPluginConfig && walletPrivateKeyFromPluginConfig.trim().length > 0) {
|
|
781
|
+
return walletPrivateKeyFromPluginConfig.trim();
|
|
782
|
+
}
|
|
783
|
+
const fromEnv = process.env[TRADERCLAW_WALLET_PRIVATE_KEY_ENV]?.trim();
|
|
784
|
+
return fromEnv && fromEnv.length > 0 ? fromEnv : void 0;
|
|
785
|
+
}
|
|
774
786
|
function parseConfig(raw) {
|
|
775
787
|
const obj = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
776
788
|
const orchestratorUrl = typeof obj.orchestratorUrl === "string" ? obj.orchestratorUrl : "";
|
|
@@ -779,7 +791,7 @@ function parseConfig(raw) {
|
|
|
779
791
|
const externalUserId = typeof obj.externalUserId === "string" ? obj.externalUserId : void 0;
|
|
780
792
|
const refreshToken = typeof obj.refreshToken === "string" ? obj.refreshToken : void 0;
|
|
781
793
|
const walletPublicKey = typeof obj.walletPublicKey === "string" ? obj.walletPublicKey : void 0;
|
|
782
|
-
const walletPrivateKey =
|
|
794
|
+
const walletPrivateKey = resolveEffectiveWalletPrivateKey(walletPrivateKeyFromPluginConfigRecord(obj));
|
|
783
795
|
const apiTimeout = typeof obj.apiTimeout === "number" ? obj.apiTimeout : 12e4;
|
|
784
796
|
const agentId = typeof obj.agentId === "string" ? obj.agentId : void 0;
|
|
785
797
|
const gatewayBaseUrl = typeof obj.gatewayBaseUrl === "string" ? obj.gatewayBaseUrl : void 0;
|
|
@@ -903,6 +915,8 @@ var solanaTraderPlugin = {
|
|
|
903
915
|
name: "Solana Trader",
|
|
904
916
|
description: "Autonomous Solana memecoin trading agent \u2014 V1-Upgraded with intelligence lab, tool envelopes, prompt scrubbing, and split skill architecture",
|
|
905
917
|
register(api) {
|
|
918
|
+
const pluginConfigRaw = api.pluginConfig && typeof api.pluginConfig === "object" && !Array.isArray(api.pluginConfig) ? api.pluginConfig : {};
|
|
919
|
+
const walletPrivateKeyFromPluginJsonOnly = walletPrivateKeyFromPluginConfigRecord(pluginConfigRaw);
|
|
906
920
|
const config = parseConfig(api.pluginConfig);
|
|
907
921
|
const { orchestratorUrl, walletId, apiKey, apiTimeout } = config;
|
|
908
922
|
if (!orchestratorUrl) {
|
|
@@ -954,18 +968,16 @@ var solanaTraderPlugin = {
|
|
|
954
968
|
initialAccessToken = sidecar.accessToken;
|
|
955
969
|
initialAccessTokenExpiresAt = sidecar.accessTokenExpiresAt;
|
|
956
970
|
}
|
|
971
|
+
const walletProofKeySource = config.walletPrivateKey && walletPrivateKeyFromPluginJsonOnly ? "plugin_json" : config.walletPrivateKey ? "env" : "absent";
|
|
957
972
|
api.logger.info(
|
|
958
|
-
`[solana-trader] Session: sidecar=${sidecar ? "yes" : "no"}, refreshToken=${effectiveRefreshToken ? "present (" + effectiveRefreshToken.slice(0, 8) + "...)" : "MISSING"}, apiKey=${apiKey ? "present" : "MISSING"}, walletPublicKey=${effectiveWalletPublicKey ? "present" : "MISSING"}`
|
|
973
|
+
`[solana-trader] Session: sidecar=${sidecar ? "yes" : "no"}, refreshToken=${effectiveRefreshToken ? "present (" + effectiveRefreshToken.slice(0, 8) + "...)" : "MISSING"}, apiKey=${apiKey ? "present" : "MISSING"}, walletPublicKey=${effectiveWalletPublicKey ? "present" : "MISSING"}, walletProofSigningKey=${walletProofKeySource}`
|
|
959
974
|
);
|
|
960
975
|
const sessionManager = new SessionManager({
|
|
961
976
|
baseUrl: orchestratorUrl,
|
|
962
977
|
apiKey: apiKey || "",
|
|
963
978
|
refreshToken: effectiveRefreshToken,
|
|
964
979
|
walletPublicKey: effectiveWalletPublicKey,
|
|
965
|
-
walletPrivateKeyProvider: () =>
|
|
966
|
-
const k = config.walletPrivateKey;
|
|
967
|
-
return typeof k === "string" && k.trim() ? k.trim() : void 0;
|
|
968
|
-
},
|
|
980
|
+
walletPrivateKeyProvider: () => resolveEffectiveWalletPrivateKey(walletPrivateKeyFromPluginJsonOnly),
|
|
969
981
|
recoverySecretProvider: async () => {
|
|
970
982
|
const sidecarData = readSessionSidecar();
|
|
971
983
|
const fromSidecar = sidecarData?.recoverySecret;
|
package/dist/src/alpha-ws.js
CHANGED
package/openclaw.plugin.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"walletPrivateKey": {
|
|
41
41
|
"type": "string",
|
|
42
42
|
"deprecated": true,
|
|
43
|
-
"description": "
|
|
43
|
+
"description": "Optional base58 signing key when the server requires wallet proof. Prefer TRADERCLAW_WALLET_PRIVATE_KEY in OpenClaw/gateway merged env or systemd EnvironmentFile instead of plaintext JSON (never commit)."
|
|
44
44
|
},
|
|
45
45
|
"apiTimeout": {
|
|
46
46
|
"type": "integer",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-traderclaw",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.103",
|
|
4
4
|
"description": "TraderClaw V1-Upgraded — Solana trading for OpenClaw with intelligence lab, tool envelopes, prompt scrubbing, read-only X social intel, and split skill docs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,15 +26,15 @@ You interact with the orchestrator **exclusively through plugin tools** (e.g. `s
|
|
|
26
26
|
|
|
27
27
|
### Official TraderClaw documentation — use before improvising fixes
|
|
28
28
|
|
|
29
|
-
**Whenever** the user hits auth/session/wallet-proof errors, your **first** actionable
|
|
29
|
+
**Whenever** the user hits auth/session/wallet-proof errors, your **first** actionable steps on the **machine that runs OpenClaw** (interactive terminal / TTY) are: run **`traderclaw login`** (complete wallet proof when prompted), then **`openclaw gateway restart`**. Then point them to:
|
|
30
30
|
|
|
31
31
|
https://docs.traderclaw.ai/docs/installation#troubleshooting-session-expired-auth-errors-or-the-agent-logged-out
|
|
32
32
|
|
|
33
33
|
### Wallet proof vs signup — do not conflate these
|
|
34
34
|
|
|
35
35
|
- **Wallet proof** is NOT account signup. It is a cryptographic step proving wallet control.
|
|
36
|
-
- **`traderclaw login`**
|
|
37
|
-
- **OpenClaw gateway ≠ your SSH shell.**
|
|
36
|
+
- **`traderclaw login`** refreshes the session when possible and runs the challenge flow when needed; the gateway process itself cannot prompt for a signing key.
|
|
37
|
+
- **OpenClaw gateway ≠ your SSH shell.** The human must re-auth on the gateway host and restart the gateway so new tokens are loaded.
|
|
38
38
|
- **Plugin id vs npm name:** `solana-traderclaw` is the npm package name, while `solana-trader` is the OpenClaw plugin id used in `plugins.entries` and `plugins.allow`.
|
|
39
39
|
|
|
40
40
|
---
|