skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
htx-exchange/htx-skills-hub105 installs

spot

HTX Spot trading request using the HTX API. Authentication requires API key and secret key. Supports mainnet.

How do I install this agent skill?

npx skills add https://github.com/htx-exchange/htx-skills-hub --skill spot
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill is a trading assistant for the HTX exchange. It enables users to check market data, manage account balances, and execute spot trades using official HTX API endpoints. The skill includes essential security features, such as masking API keys in responses and requiring explicit user confirmation before placing orders on the mainnet.

  • Socketwarn

    1 alert: gptSecurity

  • Snykfail

    Risk: HIGH · 2 issues

  • Runlayerpass

    2/3 files flagged

  • ZeroLeakspass

    1 finding · Score: 82/100

What does this agent skill do?

HTX Spot Skill

Spot trading on HTX using authenticated API endpoints. Requires API key and secret key for certain endpoints. Return the result in JSON format.

Quick Reference

Reference Data Endpoints

EndpointDescriptionRequiredOptionalAuthentication
GET /v2/market-statusReturns current market status with enum values including: 1=normal, 2=halted, 3=cancel-onlyNoneNoneNo
GET /v2/settings/common/symbolsReturns all supported trading symbols with detailed configuration including state, precision, and trading statusNonetsNo
GET /v2/settings/common/currenciesReturns all supported currencies with their configuration and display namesNonetsNo
GET /v1/settings/common/symbolsReturns symbol settings with pricing and trading precision informationNoneNoneNo
GET /v1/settings/common/market-symbolsReturns market symbol configuration for spot tradingNoneNoneNo
GET /v2/reference/currenciesReturns currency and blockchain chain reference dataNoneNoneNo
GET /v1/common/timestampReturns current server timestamp in millisecondsNoneNoneNo

Market Data Endpoints

EndpointDescriptionRequiredOptionalAuthentication
GET /market/history/klinesReturns OHLC candlestick data for the specified symbol and time periodsymbol, periodsize, fromNo
GET /market/detailReturns the latest market ticker data for a symbol including price, volume, and 24h statssymbolNoneNo
GET /market/tickersReturns latest ticker data for all trading pairsNoneNoneNo
GET /market/depthReturns order book depth (bids and asks) for a symbolsymbol, typeNoneNo
GET /market/tradeReturns the latest trade data for a symbolsymbolNoneNo
GET /market/history/tradeReturns recent trades for a symbolsymbolsizeNo
GET /market/overviewReturns 24-hour market summary statistics for all symbolsNoneNoneNo
GET /market/orderbookReturns complete order book for a symbol with full depthsymboldepthNo

Account Endpoints

EndpointDescriptionRequiredOptionalAuthentication
GET /v1/account/accountsReturns all account details for the authenticated userNoneNoneYes
GET /v1/account/accounts/{account-id}/balanceReturns balance details for a specific account including assets and liabilitiesaccount-idNoneYes
GET /v2/account/valuationReturns total asset valuation for all accounts in the user's portfolioNonevaluationCurrencyYes
GET /v2/account/asset-valuationReturns detailed asset valuation and portfolio compositionNoneNoneYes
POST /v1/account/transferTransfers assets between accountsfrom-account, to-account, currency, amountNoneYes
GET /v1/account/historyReturns account history and transaction recordsNoneaccount-id, currency, typeYes
POST /v1/futures/transferTransfers funds between spot trading account and futures contract accountcurrency, amount, typeNoneYes
GET /v1/point/accountReturns current HTX points balance and historyNoneNoneYes
POST /v1/point/transferTransfers HTX points between accountsfrom-user, to-user, amountNoneYes

Trading Endpoints

EndpointDescriptionRequiredOptionalAuthentication
POST /v1/order/orders/placePlaces a new spot trading order (limit or market)account-id, amount, symbol, typeprice, client-order-id, source, time-in-forceYes
POST /v1/order/orders/{order-id}/cancelCancels a pending orderorder-idNoneYes
POST /v1/order/orders/batchcancelCancels multiple orders matching specified criteriaNoneaccount-id, symbolYes
GET /v1/order/orders/{order-id}Returns details of a specific orderorder-idNoneYes
GET /v1/order/ordersReturns orders matching specified criteria (open, closed, cancelled)account-idsymbol, states, types, start-time, end-time, from, direct, sizeYes
GET /v1/order/orders/getClientOrderReturns order details using client-order-idclient-order-idNoneYes
GET /v1/order/matchresultsReturns trade history and fill detailsNonesymbol, types, start-time, end-time, from, direct, sizeYes

Margin Loan (Cross/Isolated) Endpoints

EndpointDescriptionRequiredOptionalAuthentication
POST /v1/margin/ordersApplies for a margin loan on cross or isolated margin accountcurrency, amountaccount-idYes
POST /v1/margin/orders/{order-id}/repayRepays a margin loan with interestorder-id, amountNoneYes
GET /v1/margin/ordersReturns margin loan orders and their statusNonecurrency, state, from, sizeYes
GET /v1/margin/accounts/balanceReturns detailed balance information for margin accountsNoneaccount-idYes

Parameters

Common Parameters

  • symbol: Trading symbol (e.g., btcusdt, ethusdt)
  • symbols: Comma-separated list of symbols
  • account-id: Account ID (can be obtained from /v1/account/accounts)
  • type: Order type
  • amount: Order amount (for buy market orders, amount is in quote currency; for others, in base currency)
  • price: Order price (required for limit orders)
  • source: Order source (default: spot-api)
  • client-order-id: Client-defined order ID (max length: 64)
  • self-match-prevent: Self-match prevention (0=disabled, 1=enabled)
  • stop-price: Stop price for stop-limit orders
  • operator: Operator for stop orders (gte, lte)
  • order-id: Order ID
  • period: Kline period/interval
  • size: Number of records to return
  • depth: Depth level (e.g., step0, step1, step2, etc.)
  • side: Order side (buy, sell)
  • states: Order states (comma-separated)
  • types: Order types (comma-separated)
  • start-date: Start date (format: yyyy-mm-dd)
  • end-date: End date (format: yyyy-mm-dd)
  • start-time: Start time (unix timestamp in milliseconds)
  • end-time: End time (unix timestamp in milliseconds)
  • from: Start ID for pagination
  • direct: Direction for pagination (prev, next)
  • accountType: Account type for asset valuation
  • valuationCurrency: Currency for valuation (e.g., BTC, USDT, CNY)
  • transactTypes: Transaction types (comma-separated)
  • limit: Number of records to return
  • fromId: Starting ID for query
  • currency: Currency name (lowercase, e.g., btc, usdt)
  • show-desc: Show description (true, false)
  • ts: Timestamp for querying (optional)
  • authorizedUser: Authorized user flag (true, false)

Enums

  • period: 1min | 5min | 15min | 30min | 60min | 4hour | 1day | 1mon | 1week | 1year
  • type (order): buy-market | sell-market | buy-limit | sell-limit | buy-ioc | sell-ioc | buy-limit-maker | sell-limit-maker | buy-stop-limit | sell-stop-limit | buy-limit-fok | sell-limit-fok | buy-stop-limit-fok | sell-stop-limit-fok
  • side: buy | sell
  • states: submitted | partial-filled | partial-canceled | filled | canceled
  • operator: gte | lte
  • accountType: spot | margin | otc | point | super-margin | investment | borrow
  • transactTypes: trade | etf | transact-fee | deduction | transfer | credit | liquidation | interest | deposit-withdraw | withdraw-fee | exchange | other-types
  • depth (step): step0 | step1 | step2 | step3 | step4 | step5

Authentication

For endpoints that require authentication, you will need to provide HTX API credentials. Required credentials:

  • apiKey: Your HTX API key (for AccessKeyId parameter)
  • secretKey: Your HTX API secret (for signing)

Base URLs:

Security

Share Credentials

Users can provide HTX API credentials by sending a file where the content is in the following format:

fe45419a...xyz
secretabc...key

Never Display Full Secrets

When showing credentials to users:

  • API Key: Show first 5 + last 4 characters: fe45419a...xyz
  • Secret Key: Always mask, show only last 5: ***...key1

Example response when asked for credentials:

Account: main
API Key: fe45419a...xyz
Secret: ***...key1
Environment: Mainnet

Listing Accounts

When listing accounts, show names and environment only — never keys:

HTX Accounts:
* main (Mainnet)
* trading (Mainnet - AWS)

Transactions in Mainnet

When performing transactions in mainnet, always confirm with the user before proceeding by asking them to write "CONFIRM" to proceed.


HTX Accounts

main

  • API Key: your_mainnet_api_key
  • Secret: your_mainnet_secret
  • Environment: https://api.huobi.pro
  • Description: Primary trading account

trading

  • API Key: your_aws_api_key
  • Secret: your_aws_secret
  • Environment: https://api-aws.huobi.pro
  • Description: AWS optimized trading

TOOLS.md Structure

## HTX Accounts

### main
- API Key: fe45419a...xyz
- Secret: secretabc...key
- Environment: https://api.huobi.pro
- Description: Primary trading account

### trading
- API Key: test456...abc
- Secret: testsecret...xyz
- Environment: https://api-aws.huobi.pro
- Description: AWS optimized trading

Agent Behavior

  1. Credentials requested: Mask secrets (show last 5 chars only)
  2. Listing accounts: Show names and environment, never keys
  3. Account selection: Ask if ambiguous, default to main
  4. When doing a transaction in mainnet, confirm with user before by asking to write "CONFIRM" to proceed
  5. New credentials: Prompt for name, environment

Adding New Accounts

When user provides new credentials:

  • Ask for account name
  • Ask: Which environment (Mainnet or Mainnet-AWS)
  • Store in TOOLS.md with masked display confirmation

Signing Requests

All authenticated endpoints require HMAC SHA256 signature:

  1. Create the pre-sign string in the following order:
    • HTTP method (GET/POST) + "\n"
    • API host (e.g., api.huobi.pro) + "\n"
    • API path (e.g., /v1/order/orders) + "\n"
    • Sorted query string parameters
  2. Append required parameters to all authenticated requests:
    • AccessKeyId: Your API key
    • SignatureMethod: HmacSHA256
    • SignatureVersion: 2
    • Timestamp: UTC timestamp in format yyyy-MM-ddTHH:mm:ss
  3. Sign the pre-sign string with secretKey using HMAC SHA256
  4. Append signature to query string as Signature parameter
  5. For POST requests, also include signature in the URL query string

Example pre-sign string:

POST\n
api.huobi.pro\n
/v1/order/orders/place\n
AccessKeyId=xxx&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2017-05-11T15:19:30

User Agent Header

Include User-Agent header with the following string: htx-spot/1.0.0 (Skill)

Important Notes

  • All timestamps are in Unix milliseconds
  • Symbol names should be lowercase (e.g., btcusdt, not BTCUSDT)
  • For market buy orders, the amount parameter represents the quote currency amount
  • For all other order types, amount represents the base currency amount
  • Account ID must be obtained from /v1/account/accounts endpoint before trading
  • Rate limits apply - see HTX API documentation for details
  • Signature must be calculated for every authenticated request
  • Timestamp in signature must be within 1 minute of server time
  • For order queries, the order created via API will no longer be queryable after being cancelled for more than 2 hours
  • The maximum query window for historical data is typically 48 hours, with data available for the last 180 days
  • When placing batch orders, maximum 10 orders per batch
  • Fee rates query supports maximum 10 trading pairs at a time
  • All request endpoints must match the endpoints specified in the documentation.

API Documentation

For more details, refer to the official HTX API documentation: https://www.htx.com/en-us/opend/newApiPages/

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/htx-exchange/htx-skills-hub/spot">View spot on skillZs</a>