crypto-com-app
Execute crypto trades (buy, sell, swap, exchange), manage cash deposits and withdrawals, and query account balances, market prices, and transaction history via the Crypto.com APP API. View weekly trading limits, portfolio positions, bank accounts, and payment networks. Use when the user wants to tra
By crypto-com · 1,071 installs
npx skills add crypto-com/crypto-agent-trading --skill crypto-com-app
Source repository · Upstream listing
Skill: crypto com app
Agent Capability Requirements
This skill requires your agent platform to support the following capabilities. If your platform lacks any required capability, the skill will not function.
Capability Required Details
Shell command execution Yes Must be able to run npx tsx ./scripts/... and capture stdout
Environment variables Yes Must read CDC API KEY and CDC API SECRET from the shell environment
JSON parsing Yes Must parse structured JSON from script stdout to extract fields
Multi turn conversation Yes Trading uses a quote → confirm flow that spans multiple user turns
Persistent memory No Used for confirmation required preference. If unsupported, default to always confirming trades
Elapsed time awareness No Used to check quote expiry ( countdown field). If unsupported, always attempt confirmation and handle invalid quotation errors gracefully
CRITICAL: How This Skill Works
You MUST use the TypeScript scripts for ALL API interactions. NEVER call the API directly with curl , fetch , or any other HTTP method.
The scripts handle request signing, error handling, and response formatting. If you bypass them:
The request will fail (missing HMAC signature)
The response won't be filtered or structured
For every user request, find the matching command below and run it via npx tsx . Read the JSON output. Act on it.
Configurations
BASE URL: https://wapi.crypto.com
CDC API KEY: {{env.CDC API KEY}}
CDC API SECRET: {{env.CDC API SECRET}}
CONFIRMATION REQUIRED: {{memory.confirmation required}} (Default: true)
SKILL DIR: The directory containing this SKILL.md file. Resolve it from the path you loaded this file from (e.g. if you read /home/user/skills/crypto com app/SKILL.md , then SKILL DIR is /home/user/skills/crypto com app ).
Environment Setup
Both CDC API KEY and CDC API SECRET must be set as environment variables before use.
Before running any script , check whether both variables are set by running:
If either prints empty instead of set , prompt the user:
"Your API credentials are not configured. Please set them in your terminal before I can proceed:
You can generate an API key at https://help.crypto.com/en/articles/13843786 api key management.
Let me know once you've set them."
Then stop and wait for the user to confirm before retrying.
If a script returns a MISSING ENV error, treat it the same way: prompt the user to set the variables and wait.
Script Commands
ALL API interactions MUST go through these scripts. They handle signing, execution, filtering, and error formatting. Run the appropriate command below via shell, then parse the JSON output.
Prerequisite: npx tsx (Node.js 18+ required; tsx is fetched automatically by npx ).
Important: All script paths below use $SKILL DIR as a placeholder for this skill's root directory. Resolve it from the path you loaded this SKILL.md from, or cd into the skill directory and use ./scripts/... as the path. Either approach works.
Account Commands
Trade Commands
Trading follows a two step flow : get a quotation first, then confirm the order.
How to map user intent to trade type:
User says Trade type From To
"Buy CRO with 100 USD" purchase USD (fiat) CRO (crypto)
"Sell 0.1 BTC" sale BTC (crypto) USD (fiat)
"Swap 0.1 BTC to ETH" exchange BTC (crypto) ETH (crypto)
Quotation JSON params by trade type:
Type JSON fields
purchase {"from currency":"USD","to currency":"CRO","from amount":"100"} or use to amount instead
sale {"from currency":"BTC","to currency":"USD","from amount":"0.1","fixed side":"from"}
exchange {"from currency":"BTC","to currency":"ETH","from amount":"0.1","side":"buy"}
Example — "Buy CRO with 100 USD":
1. Run: npx tsx $SKILL DIR/scripts/trade.ts quote purchase '{"from currency":"USD","to currency":"CRO","from amount":"100"}'
2. Read data.id , data.from amount , data.to amount , data.countdown from the response.
3. If confirmation required (default): Ask user "Confirm: 100 USD for X CRO? Valid for {countdown}s. Reply 'YES' to proceed."
If user says YES (within countdown): npx tsx $SKILL DIR/scripts/trade.ts confirm purchase <data.id
4. If confirmation opted out ( memory.confirmation required is false ): Skip asking and immediately run npx tsx $SKILL DIR/scripts/trade.ts confirm purchase <data.id
Opt in / Opt out: Users can say "stop asking for confirmation" to auto execute trades, or "require confirmation" to re enable the prompt. See Section 3 below.
Coin Discovery Commands
Required JSON parameters:
Parameter Type Allowed values
sort by string rank , market cap , alphabetical , volume , performance
sort direction string asc , desc
native currency string Uppercase currency code (e.g. USD )
keyword string Search string, 1–100 chars; matches coin name and symbol only
page size integer Number of results per page
Optional: page token — opaque token for fetching the next page (see pagination below).
Pagination: The response includes a pagination object with has more (boolean) and next page token (string). When has more is true , pass next page token as page token in the next request to fetch the next page.
Key response fields per coin: rails id (identical to currency id / currency in trade and account APIs — use this to cross reference), price native , price usd , percent change native (price performance over past timeframes, e.g. percent change 24h native ).
Cash (Fiat) Commands
Cash commands handle deposits, withdrawals, and bank account management.
Key parameters:
Parameter Description Example values
CURRENCY Uppercase currency code USD , EUR , GBP , AUD
DEPOSIT METHOD Network ID from payment networks us ach , sepa , uk fps
VIBAN TYPE Same as deposit method / withdrawal network us ach , sepa , uk fps
Withdrawal order JSON params:
Field Required Description
currency Yes Currency code (e.g. "USD" )
amount Yes Amount as string (e.g. "500.00" )
viban type Yes Payment network (e.g. "us ach" )
bank account id No Specific bank account ID
Example — "How do I deposit USD?":
1. Run: npx tsx $SKILL DIR/scripts/fiat.ts payment networks USD
2. Read data array — each entry has deposit push payment networks (e.g. ["us ach", "us wire transfer"] )
3. For details: npx tsx $SKILL DIR/scripts/fiat.ts deposit methods USD us ach
4. Read data array — contains bank details with routing number, account number, etc.
Example — "Withdraw 500 USD via ACH":
1. Run: npx tsx $SKILL DIR/scripts/fiat.ts withdrawal details USD us ach — check quotas and fees
2. Run: npx tsx $SKILL DIR/scripts/fiat.ts create withdrawal order '{"currency":"USD","amount":"500","viban type":"us ach"}'
3. Read data.id (order ID), data.fee , data.receivable amount from response
4. Confirm with user: "Withdraw 500 USD via ACH. Fee: {fee}. You'll receive: {receivable amount}. Confirm?"
5. If YES: npx tsx $SKILL DIR/scripts/fiat.ts create withdrawal <order id
6. If TOTP required, the script will prompt for a 6 digit authenticator code on stderr
Output Format
Every script prints structured JSON to stdout:
Success:
Error:
Constraints
Validation: Success requires ok: true in the script output.
Confirmation Window: Quote validity is defined by the countdown field in the quotation data.
Execution Warning: If order confirmation takes 5s, notify: "Order submitted but taking longer than expected. Check order status with 'Show recent trades'".
Rate Limits:
Max 10 trades per minute .
Max 100 API calls per minute .
On HTTP 429 ( RATE LIMITED error): wait 60 seconds before retrying the same request. Inform the user: "Rate limit reached — please wait 60 seconds before trying again."
Error Handling
All scripts return structured errors. Parse the error field to determine the appropriate response.
Script Error Codes
These are the error values in the script's JSON output. They tell you what category of failure occurred.
Error Code Meaning Agent Response
MISSING ENV CDC API KEY or CDC API SECRET not set Tell user to set env vars via terminal
API ERROR API returned non 200 or ok !== true Report: "Transaction failed: {error message}"
INVALID ARGS Bad command line arguments Show correct usage from the error message
QUOTATION FAILED Quotation request rejected by API Report the error message to user (see API errors below)
EXECUTION FAILED Order confirmation failed Report and suggest: "Check order status with 'Show recent trades'"
API KEY NOT FOUND Key already revoked or does not exist "API key not found — it may have already been revoked."
RATE LIMITED Too many requests (HTTP 429) "Rate limit reached — please wait 60 seconds before trying again."
UNKNOWN Unexpected error Report the raw error message
Rule: When ok is false in the output, stop the current operation and report the error to the user using the guidance above. Never proceed to the next step after a failure.
Common API Errors (Quick Reference)
These are the specific API error codes that appear inside the error message of QUOTATION FAILED , EXECUTION FAILED , or API ERROR responses. They tell you why the API rejected the request.
error Meaning Recovery
not enough balance Insufficient funds Check balances, reduce trade amount
invalid currency Currency code not recognized Verify via coin search
invalid quotation Quote expired or already used Request a new quotation
failed to create quotation Quotation engine error Retry shortly
not eligible for prime Not eligible for Prime benefits Proceed without Prime
unauthorized Account not approved for trading Contact support
restricted feature Feature restricted on account Report error message to user
existing currency order error An existing order is in progress Wait or cancel existing order
viban purchase not enabled Fiat to crypto not enabled Account feature not available
crypto viban not enabled Crypto to fiat not enabled Account feature not available
bank transfer not enabled Bank transfer not enabled Account feature not available
missing parameter Required parameter missing Script bug — report it
failed to create transaction Transaction creation failed Retry or contact support
key not active API key revoked or expired Generate a new API key, update env vars
api key not found Key doesn't exist or belongs to another user Verify correct key is set in CDC API KEY
totp required Withdrawal needs 2FA code Script handles automatically — prompts user for authenticator code
withdrawal limit exceeded Daily/monthly quota exceeded Show limits via withdrawal details , reduce amount
invalid bank account Bank account not eligible Check bank accounts for valid accounts with status: completed
withdrawal cooling off Recently changed withdrawal settings Wait for cooling off period, report error message to user
email cooldown Too many deposit info emails Wait for cooldown period (shown in error), try again later
For dynamic errors (limit exceeded, currency disabled, cooling off, etc.), report the error and error message directly to the user. For full details, see [references/errors.md](references/errors.md).
Logic & Rules
1. Asset & Source Disambiguation
Determine the trade type first:
Pu