@xquik/tweetclaw 1.4.2 → 1.5.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/README.md +2 -2
- package/openclaw.plugin.json +4 -4
- package/package.json +1 -1
- package/skills/tweetclaw/SKILL.md +2 -2
- package/src/index.ts +7 -7
- package/src/mpp.ts +2 -2
- package/src/tools/tweetclaw.ts +1 -1
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -74,10 +74,10 @@ Top up credits from the Xquik dashboard or via `POST /credits/topup`. All 120 en
|
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
76
|
npm i mppx viem
|
|
77
|
-
openclaw config set plugins.entries.tweetclaw.config.
|
|
77
|
+
openclaw config set plugins.entries.tweetclaw.config.tempoSigningKey '0xYOUR_TEMPO_ACCOUNT_KEY'
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
MPP (Machine Payments Protocol) lets agents pay per API call via Tempo (USDC). No account, no API key, no subscription. 16 read-only endpoints.
|
|
80
|
+
MPP (Machine Payments Protocol) lets agents pay per API call via Tempo (USDC). No account, no API key, no subscription. 16 read-only endpoints. Create a Tempo account with `mppx account create` or at [tempo.xyz](https://tempo.xyz). The key stays local and is only used to sign payment proofs.
|
|
81
81
|
|
|
82
82
|
MPP-eligible endpoints: tweet lookup ($0.00015), tweet search ($0.00015/tweet), user lookup ($0.00015), user tweets ($0.00015/tweet), follower check ($0.00105), article lookup ($0.00105), media download ($0.00015/media), trends ($0.00045), X trends ($0.00045), quotes ($0.00015/tweet), replies ($0.00015/tweet), retweeters ($0.00015/user), favoriters ($0.00015/user), thread ($0.00015/tweet), user likes ($0.00015/tweet), user media ($0.00015/tweet).
|
|
83
83
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
"id": "tweetclaw",
|
|
3
3
|
"name": "TweetClaw",
|
|
4
4
|
"version": "1.4.1",
|
|
5
|
-
"description": "Post tweets, reply, like, retweet, follow, DM from your chat - full X/Twitter automation powered by Xquik. 120 endpoints, reads from $0.00015/call. Requires an Xquik API key or Tempo
|
|
5
|
+
"description": "Post tweets, reply, like, retweet, follow, DM from your chat - full X/Twitter automation powered by Xquik. 120 endpoints, reads from $0.00015/call. Requires an Xquik API key or Tempo signing key.",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
9
9
|
"properties": {
|
|
10
10
|
"apiKey": { "type": "string", "minLength": 1, "description": "Xquik API key (get one at dashboard.xquik.com). Required for full access to all 120 endpoints." },
|
|
11
|
-
"
|
|
11
|
+
"tempoSigningKey": { "type": "string", "minLength": 1, "description": "Tempo signing key for MPP pay-per-use mode. No account needed. 16 read-only X-API endpoints." },
|
|
12
12
|
"baseUrl": { "type": "string", "default": "https://xquik.com" },
|
|
13
13
|
"pollingInterval": { "type": "number", "default": 60, "description": "Event polling interval in seconds" },
|
|
14
14
|
"pollingEnabled": { "type": "boolean", "default": true }
|
|
15
15
|
},
|
|
16
16
|
"anyOf": [
|
|
17
17
|
{ "required": ["apiKey"] },
|
|
18
|
-
{ "required": ["
|
|
18
|
+
{ "required": ["tempoSigningKey"] }
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
"uiHints": {
|
|
22
22
|
"apiKey": { "label": "Xquik API Key", "sensitive": true, "placeholder": "xq_...", "help": "Full access to all 120 endpoints. Generate at dashboard.xquik.com." },
|
|
23
|
-
"
|
|
23
|
+
"tempoSigningKey": { "label": "Tempo Signing Key (MPP)", "sensitive": true, "placeholder": "0x...", "help": "Pay-per-use mode via Machine Payments Protocol. No account needed. 16 read-only X-API endpoints only. Requires mppx and viem packages." },
|
|
24
24
|
"baseUrl": { "label": "API Base URL", "placeholder": "https://xquik.com", "advanced": true, "help": "Only change if using a self-hosted Xquik instance." },
|
|
25
25
|
"pollingInterval": { "label": "Event Poll Interval (seconds)", "advanced": true, "help": "How often to check for new monitor events. Default: 60 seconds." },
|
|
26
26
|
"pollingEnabled": { "label": "Enable Event Notifications", "advanced": true, "help": "Deliver monitor alerts and extraction completions to your chat." }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xquik/tweetclaw",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Post tweets, reply, like, retweet, follow, DM & more from OpenClaw - full X/Twitter automation via Xquik. 120 endpoints, reads from $0.00015/call.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -102,10 +102,10 @@ Get a key at [dashboard.xquik.com](https://dashboard.xquik.com/).
|
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
104
|
npm i mppx viem
|
|
105
|
-
openclaw config set plugins.entries.tweetclaw.config.
|
|
105
|
+
openclaw config set plugins.entries.tweetclaw.config.tempoSigningKey '0xYOUR_SIGNING_KEY'
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
MPP gives agents access to 16 read-only X-API endpoints without any account or subscription. The mppx SDK handles HTTP 402 payment challenges automatically.
|
|
108
|
+
MPP gives agents access to 16 read-only X-API endpoints without any account or subscription. The mppx SDK handles HTTP 402 payment challenges automatically. The signing key stays local and is only used to sign payment proofs.
|
|
109
109
|
|
|
110
110
|
## Tools
|
|
111
111
|
|
package/src/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ function isPollerEvent(value: unknown): value is PollerEvent {
|
|
|
18
18
|
|
|
19
19
|
function isPluginConfig(value: unknown): value is PluginConfig {
|
|
20
20
|
if (typeof value !== 'object' || value === null) return false;
|
|
21
|
-
return 'apiKey' in value || '
|
|
21
|
+
return 'apiKey' in value || 'tempoSigningKey' in value;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
const DEFAULT_POLLING_INTERVAL_SECONDS = 60;
|
|
@@ -76,25 +76,25 @@ export default function register(api: OpenClawApi, fetchFunction?: FetchFunction
|
|
|
76
76
|
const config: unknown = api.pluginConfig;
|
|
77
77
|
if (!isPluginConfig(config)) {
|
|
78
78
|
api.logger.warn(
|
|
79
|
-
"TweetClaw: No API key or Tempo
|
|
79
|
+
"TweetClaw: No API key or Tempo signing key configured. Run: openclaw config set plugins.entries.tweetclaw.config.apiKey 'xq_YOUR_KEY' or set tempoSigningKey for MPP pay-per-use",
|
|
80
80
|
);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
const { apiKey, baseUrl = 'https://xquik.com',
|
|
85
|
-
const isMppMode = apiKey === undefined &&
|
|
84
|
+
const { apiKey, baseUrl = 'https://xquik.com', tempoSigningKey } = config;
|
|
85
|
+
const isMppMode = apiKey === undefined && tempoSigningKey !== undefined;
|
|
86
86
|
const credential = apiKey ?? '';
|
|
87
87
|
|
|
88
88
|
if (isMppMode) {
|
|
89
89
|
void (async (): Promise<void> => {
|
|
90
90
|
try {
|
|
91
|
-
await initMpp(
|
|
92
|
-
api.logger.info('TweetClaw: MPP initialized - Tempo
|
|
91
|
+
await initMpp(tempoSigningKey);
|
|
92
|
+
api.logger.info('TweetClaw: MPP initialized - Tempo account ready');
|
|
93
93
|
} catch (error: unknown) {
|
|
94
94
|
api.logger.error(`TweetClaw: MPP init failed - ${error instanceof Error ? error.message : String(error)}`);
|
|
95
95
|
}
|
|
96
96
|
})();
|
|
97
|
-
api.logger.info('TweetClaw: MPP mode - pay-per-use via Tempo (16 X-API endpoints, no subscription needed)');
|
|
97
|
+
api.logger.info('TweetClaw: MPP mode - pay-per-use via Tempo account (16 X-API endpoints, no subscription needed)');
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
const request = createProxiedRequest(baseUrl, credential, fetchFunction);
|
package/src/mpp.ts
CHANGED
|
@@ -22,7 +22,7 @@ function createModuleLoader(): ModuleLoader {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async function initMpp(
|
|
25
|
+
async function initMpp(tempoSigningKey: string, loadModule?: ModuleLoader): Promise<void> {
|
|
26
26
|
const load = loadModule ?? createModuleLoader();
|
|
27
27
|
const mppxMod = await load('mppx/client').catch((): never => {
|
|
28
28
|
throw new Error('MPP requires mppx package. Run: npm i mppx viem');
|
|
@@ -35,7 +35,7 @@ async function initMpp(tempoPrivateKey: string, loadModule?: ModuleLoader): Prom
|
|
|
35
35
|
if (!isRecord(mppxMod.Mppx)) throw new Error('mppx missing Mppx');
|
|
36
36
|
const createMethod: unknown = mppxMod.Mppx.create;
|
|
37
37
|
if (!isCallable(createMethod)) throw new Error('mppx Mppx.create is not a function');
|
|
38
|
-
const account: unknown = viemMod.privateKeyToAccount(
|
|
38
|
+
const account: unknown = viemMod.privateKeyToAccount(tempoSigningKey);
|
|
39
39
|
const method: unknown = mppxMod.tempo({ account });
|
|
40
40
|
createMethod({ methods: [method] });
|
|
41
41
|
}
|
package/src/tools/tweetclaw.ts
CHANGED
|
@@ -302,7 +302,7 @@ async () => {
|
|
|
302
302
|
- Subscription required: /api/v1/styles (X API refresh when cache >7 days), /api/v1/x/profile, /api/v1/x/communities, /api/v1/x/dm, /api/v1/extractions, /api/v1/draws, /api/v1/monitors, /api/v1/events, /api/v1/webhooks, /api/v1/styles/:username/performance, /api/v1/trending/:source
|
|
303
303
|
- Write actions (subscription required): POST /api/v1/x/tweets, DELETE /api/v1/x/tweets/:id, POST|DELETE /api/v1/x/tweets/:id/like, POST /api/v1/x/tweets/:id/retweet, POST|DELETE /api/v1/x/users/:id/follow, POST /api/v1/x/dm/:userId, POST /api/v1/x/media, PATCH /api/v1/x/profile, PATCH /api/v1/x/profile/avatar, PATCH /api/v1/x/profile/banner, POST|DELETE /api/v1/x/communities, POST|DELETE /api/v1/x/communities/:id/join
|
|
304
304
|
- IMPORTANT: Always attempt the request. Never assume subscription status. The API returns a clear error if subscription is missing.
|
|
305
|
-
- MPP MODE: When configured with
|
|
305
|
+
- MPP MODE: When configured with a Tempo signing key (no API key), the mppx SDK auto-handles 402 challenges by paying via Tempo (USDC). Only the 16 MPP-eligible endpoints work in this mode.
|
|
306
306
|
|
|
307
307
|
## Error handling
|
|
308
308
|
- If response contains "subscription is inactive" or status 402, call POST /api/v1/subscribe to get checkout URL
|
package/src/types.ts
CHANGED