$npx -y skills add Kucoin/kucoin-skills-hub --skill earnKuCoin Earn products using the KuCoin API. Query Simple Earn and Structured Earn products. Authentication requires API Key, API Secret, and Passphrase.
| 1 | # KuCoin Earn Skill |
| 2 | |
| 3 | Query KuCoin Earn products using authenticated API endpoints. Covers Simple Earn (savings, staking, promotions) and Structured Earn (dual investment) queries. Requires API Key, Secret Key, and Passphrase for authenticated endpoints. Return the result in JSON format. |
| 4 | |
| 5 | > **Note:** This skill only supports Classic REST API GET endpoints (read-only operations). |
| 6 | |
| 7 | ## Quick Reference |
| 8 | |
| 9 | ### Simple Earn |
| 10 | |
| 11 | | Endpoint | Description | Required | Optional | Authentication | |
| 12 | |----------|-------------|----------|----------|----------------| |
| 13 | | `/api/v1/earn/redeem-preview` (GET) | Get Redeem Preview | orderId | None | Yes | |
| 14 | | `/api/v1/earn/saving/products` (GET) | Get Savings Products | None | currency, currentPage, pageSize | Yes | |
| 15 | | `/api/v1/earn/promotion/products` (GET) | Get Promotion Products | None | currency, currentPage, pageSize | Yes | |
| 16 | | `/api/v1/earn/staking/products` (GET) | Get Staking Products | None | currency, currentPage, pageSize | Yes | |
| 17 | | `/api/v1/earn/kcs-staking/products` (GET) | Get KCS Staking Products | None | currency, currentPage, pageSize | Yes | |
| 18 | | `/api/v1/earn/eth-staking/products` (GET) | Get ETH Staking Products | None | currency, currentPage, pageSize | Yes | |
| 19 | | `/api/v1/earn/hold-assets` (GET) | Get Account Holding | None | currency, productId, productCategory, currentPage, pageSize | Yes | |
| 20 | |
| 21 | ### Structured Earn |
| 22 | |
| 23 | | Endpoint | Description | Required | Optional | Authentication | |
| 24 | |----------|-------------|----------|----------|----------------| |
| 25 | | `/api/v1/struct-earn/orders` (GET) | Get Structured Product Orders. **Note: This endpoint may not be available (returns 400100).** | None | currency, status, currentPage, pageSize | Yes | |
| 26 | | `/api/v1/struct-earn/dual/products` (GET) | Get Dual Investment Products. **Note: This endpoint may not be available (returns 400100).** | None | currency, currentPage, pageSize | Yes | |
| 27 | |
| 28 | --- |
| 29 | |
| 30 | ## Parameters |
| 31 | |
| 32 | ### Common Parameters |
| 33 | |
| 34 | * **orderId**: Holding ID, used for redeem preview |
| 35 | * **currency**: Currency code filter (e.g., `USDT`, `BTC`, `KCS`, `ETH`) |
| 36 | * **productId**: Earn product ID (e.g., `2611`) |
| 37 | * **productCategory**: Product category filter for account holdings |
| 38 | * **currentPage**: Current page number for paginated results (default: 1) |
| 39 | * **pageSize**: Number of results per page. Minimum is 10, maximum is 500 (default: 15) |
| 40 | * **status**: Order status filter for structured product queries |
| 41 | |
| 42 | ### Enums |
| 43 | |
| 44 | * **productCategory**: `DEMAND` | `STAKING` | `KCS_STAKING` | `ETH_STAKING` | `PROMOTION` |
| 45 | * **status** (structured orders): `PENDING` | `ONGOING` | `UNSOLD` | `SETTLING` | `FINISHED` |
| 46 | * **productStatus**: `ONGOING` | `PENDING` | `FULL` | `INTERESTING` |
| 47 | * **holdingStatus**: `LOCKED` | `REDEEMING` |
| 48 | * **productType**: `TIME` | `DEMAND` |
| 49 | |
| 50 | ## Authentication |
| 51 | |
| 52 | For endpoints that require authentication, you will need to provide KuCoin API credentials. |
| 53 | Required credentials: |
| 54 | |
| 55 | * **API Key** (`KC-API-KEY`): Your KuCoin API key (for header) |
| 56 | * **Secret Key**: Your KuCoin API secret (for HMAC-SHA256 signing) |
| 57 | * **Passphrase** (`KC-API-PASSPHRASE`): Your KuCoin API passphrase (encrypted with HMAC-SHA256) |
| 58 | |
| 59 | Base URL: |
| 60 | * Production: https://api.kucoin.com |
| 61 | |
| 62 | ## Security |
| 63 | |
| 64 | ### Share Credentials |
| 65 | |
| 66 | Users can provide KuCoin API credentials by sending a file where the content is in the following format: |
| 67 | |
| 68 | ```bash |
| 69 | abc123...apikey |
| 70 | secret123...key |
| 71 | mypassphrase |
| 72 | ``` |
| 73 | |
| 74 | ### Never Disclose API Key, Secret, and Passphrase |
| 75 | |
| 76 | Never disclose the location of the API key, secret, and passphrase file. |
| 77 | |
| 78 | Never send the API key, secret, and passphrase to any website other than the production API endpoint. |
| 79 | |
| 80 | ### Never Display Full Secrets |
| 81 | |
| 82 | When showing credentials to users: |
| 83 | - **API Key:** Show first 5 + last 4 characters: `abc12...6789` |
| 84 | - **Secret Key:** Always mask, show only last 5: `***...x9y8z` |
| 85 | - **Passphrase:** Never display |
| 86 | |
| 87 | Example response when asked for credentials: |
| 88 | Account: main |
| 89 | API Key: abc12...6789 |
| 90 | Secret: ***...x9y8z |
| 91 | Passphrase: ******** |
| 92 | Environment: Production |
| 93 | |
| 94 | ### Listing Accounts |
| 95 | |
| 96 | When listing accounts, show names and environment only -- never keys: |
| 97 | KuCoin Accounts: |
| 98 | * main (Production) |
| 99 | * earn-bot (Production) |
| 100 | |
| 101 | ### Transactions in Mainnet |
| 102 | |
| 103 | When performing transactions in mainnet (purchase, redeem), always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed. |
| 104 | |
| 105 | --- |
| 106 | |
| 107 | ## KuCoin Accounts |
| 108 | |
| 109 | ### main |
| 110 | - API Key: your_api_key |
| 111 | - Secret Key: your_secret_key |
| 112 | - Passphrase: your_passphrase |