{"skill":{"slug":"x2c-publish","displayName":"X2c Publish","summary":"X2C Distribution and Wallet API — publish video to X2C platform, manage assets (balance, claim X2C, swap to USDC, withdraw, transactions).","description":"---\nname: x2c-publish\nversion: \"0.1.0\"\ndescription: X2C Distribution and Wallet API — publish video to X2C platform, manage assets (balance, claim X2C, swap to USDC, withdraw, transactions).\nmetadata:\n  {\n    \"openclaw\":\n      { \"emoji\": \"📤\", \"requires\": { \"env\": [\"X2C_API_KEY\"] }, \"primaryEnv\": \"X2C_API_KEY\" },\n  }\n---\n\n# X2C Publish - Distribution & Wallet API\n\nPublish video content to the X2C platform and manage digital assets.\n\n## Critical Rules\n\n- Complete ALL workflow steps in order — never skip steps\n- Always add timeout to curl commands: `-m 60`\n- NEVER retry failed requests — report error and ask user\n- Check project status before publishing to avoid duplicates\n- Cover URL must be an image (jpg/png/webp), never a video URL\n\n## Multi-User Support\n\nStore API key in `credentials/{USER_ID}.json`:\n\n```json\n{\n  \"x2cApiKey\": \"x2c_sk_xxx\"\n}\n```\n\nSet `USER_ID` env var when calling. OpenClaw passes it automatically from chat context.\n\nOr set `X2C_API_KEY` env var, or configure via `skills.\"x2c-publish\".env.X2C_API_KEY` in `~/.openclaw/openclaw.json`.\n\n## Distribution Workflow\n\n```\n1. distribution/categories → Get categories\n2. distribution/upload-url → Get S3 presigned upload URLs\n3. Upload files to S3 via HTTP PUT\n4. distribution/publish → Submit with public_url from Step 3\n5. distribution/query → Check review status\n6. distribution/add-episodes → Add more episodes\n7. distribution/list → List all projects\n```\n\nTwo ways to provide videos:\n\n1. **S3 Upload** — use upload-url workflow for local files\n2. **External URL** — use existing video URLs directly in publish\n\n### API Endpoint\n\nAll requests go to the X2C Open API. The base URL is configured via `X2C_API_BASE_URL` env var or defaults to the production endpoint.\n\nHeaders:\n\n- `Content-Type: application/json`\n- `X-API-Key: <your_x2c_api_key>`\n\n### Get Categories\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"distribution/categories\", \"lang\": \"zh-CN\"}'\n```\n\n### Get Upload URLs\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\n    \"action\": \"distribution/upload-url\",\n    \"files\": [\n      {\"file_type\": \"cover\", \"file_name\": \"cover.jpg\", \"content_type\": \"image/jpeg\"},\n      {\"file_type\": \"video\", \"file_name\": \"ep1.mp4\", \"content_type\": \"video/mp4\"}\n    ]\n  }'\n```\n\nResponse includes `upload_url`, `upload_headers`, and `public_url`.\n\n### Upload to S3\n\nUse the `upload_url` and `upload_headers` from the previous response:\n\n```bash\ncurl -X PUT \"<upload_url>\" \\\n  -H \"Content-Type: image/jpeg\" \\\n  <additional headers from upload_headers> \\\n  --data-binary @cover.jpg\n```\n\n### Publish Project\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\n    \"action\": \"distribution/publish\",\n    \"title\": \"My Drama\",\n    \"description\": \"A story about...\",\n    \"category_id\": \"uuid\",\n    \"cover_url\": \"https://...\",\n    \"video_urls\": [\"https://...\"],\n    \"enable_prediction\": false\n  }'\n```\n\n| Param             | Required | Description                  |\n| ----------------- | -------- | ---------------------------- |\n| title             | Yes      | Project name (max 100 chars) |\n| description       | Yes      | Synopsis (max 2000 chars)    |\n| category_id       | Yes      | Category UUID                |\n| cover_url         | Yes      | Cover image URL              |\n| video_urls        | Yes      | Array of video URLs (1-10)   |\n| enable_prediction | No       | Enable prediction market     |\n\n### Query Status\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"distribution/query\", \"project_id\": \"uuid\"}'\n```\n\nStatus values: `draft`, `pending_review`, `approved`, `rejected`\n\n### Add Episodes\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\n    \"action\": \"distribution/add-episodes\",\n    \"project_id\": \"uuid\",\n    \"video_urls\": [\"https://...\"]\n  }'\n```\n\n### List Projects\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"distribution/list\", \"page\": 1, \"page_size\": 20, \"status\": \"approved\"}'\n```\n\n## Wallet API (Asset Management)\n\n### Get Balance\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"wallet/balance\"}'\n```\n\nReturns: credits, x2c_wallet_balance, x2c_pending_claim, x2c_pending_release, usdc_balance, wallet_address.\n\n### Claim X2C\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"wallet/claim-x2c\", \"amount\": 50.0}'\n```\n\n### Swap X2C to USDC\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"wallet/swap-x2c\", \"amount\": 100.0}'\n```\n\n### Withdraw USDC\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"wallet/withdraw-usdc\", \"amount\": 10.0, \"to_address\": \"SolanaAddress...\"}'\n```\n\n### Transaction History\n\n```bash\ncurl -m 60 -X POST \"$X2C_API_BASE_URL\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"X-API-Key: $X2C_API_KEY\" \\\n  -d '{\"action\": \"wallet/transactions\", \"page\": 1, \"page_size\": 20, \"type\": \"all\"}'\n```\n\nTypes: `earnings` (mining, distribution, referral, etc.), `purchases` (consume, swap, withdrawal, etc.), or `all`.\n","tags":{"latest":"0.1.0"},"stats":{"comments":0,"downloads":675,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":1},"createdAt":1773052001274,"updatedAt":1779077843919},"latestVersion":{"version":"0.1.0","createdAt":1773052001274,"changelog":"Initial release of x2c-publish — a skill for publishing videos to X2C and managing wallet assets.\n\n- Publish video content to the X2C platform using a structured, multi-step workflow\n- Manage distribution: upload videos, check review status, add episodes, and list projects\n- Full wallet management: view balances, claim X2C, swap to USDC, withdraw funds, and view transaction history\n- Strict publishing rules and error handling to ensure reliable integration\n- Multi-user support via user-bound API keys in OpenClaw environment or credentials","license":"MIT-0"},"metadata":{"setup":[{"key":"X2C_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"patches429","userId":"s171by77r8sahftxk2h3besw5s884a4c","displayName":"Parker","image":"https://avatars.githubusercontent.com/u/169116739?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089812640}}