Skip to main content

cryptocom-python

Python SDK (sync and async) for Cryptocom cryptocurrency exchange with Rest and WS capabilities.

Installation

pip install crypto-com-sdk

Usage

Sync

from cryptocom import CryptocomSync

def main():
    instance = CryptocomSync({})
    ob =  instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = instance.fetch_balance()
    # order = instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

main()

Async

import sys
import asyncio
from cryptocom import CryptocomAsync

### on Windows, uncomment below:
# if sys.platform == 'win32':
# 	asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

async def main():
    instance = CryptocomAsync({})
    ob =  await instance.fetch_order_book("BTC/USDC")
    print(ob)
    #
    # balance = await instance.fetch_balance()
    # order = await instance.create_order("BTC/USDC", "limit", "buy", 1, 100000)

    # once you are done with the exchange
    await instance.close()

asyncio.run(main())

Websockets

import sys
from cryptocom import CryptocomWs

### on Windows, uncomment below:
# if sys.platform == 'win32':
# 	asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

async def main():
    instance = CryptocomWs({})
    while True:
        ob = await instance.watch_order_book("BTC/USDC")
        print(ob)
        # orders = await instance.watch_orders("BTC/USDC")

    # once you are done with the exchange
    await instance.close()

asyncio.run(main())

Raw call

You can also construct custom requests to available "implicit" endpoints

        request = {
            'type': 'candleSnapshot',
            'req': {
                'coin': coin,
                'interval': tf,
                'startTime': since,
                'endTime': until,
            },
        }
        response = await instance.public_post_info(request)

Available methods

REST Unified

  • create_advanced_order_request(self, symbol: Str, type: Str, side: Str, amount: Num, price: Num = None, params: dict = {})
  • create_order_request(self, symbol: Str, type: OrderType, side: OrderSide, amount: Num, price: Num = None, params: dict = {})
  • create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params: dict = {})
  • create_orders(self, orders: list[OrderRequest], params: dict = {})
  • fetch_accounts(self, params: dict = {})
  • fetch_balance(self, params: dict = {})
  • fetch_currencies(self, params: dict = {})
  • fetch_deposit_address(self, code: str, params: dict = {})
  • fetch_deposit_addresses_by_network(self, code: str, params: dict = {})
  • fetch_deposit_withdraw_fees(self, codes: Strings = None, params: dict = {})
  • fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_funding_rate(self, symbol: str, params: dict = {})
  • fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_markets(self, params: dict = {})
  • fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params: dict = {})
  • fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_order_book(self, symbol: str, limit: Int = None, params: dict = {})
  • fetch_order(self, id: str, symbol: Str = None, params: dict = {})
  • fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_position(self, symbol: str, params: dict = {})
  • fetch_positions(self, symbols: Strings = None, params: dict = {})
  • fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_ticker(self, symbol: str, params: dict = {})
  • fetch_tickers(self, symbols: Strings = None, params: dict = {})
  • fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params: dict = {})
  • fetch_trading_fee(self, symbol: str, params: dict = {})
  • fetch_trading_fees(self, params: dict = {})
  • fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • cancel_all_orders(self, symbol: Str = None, params: dict = {})
  • cancel_order(self, id: str, symbol: Str = None, params: dict = {})
  • cancel_orders_for_symbols(self, orders: list[CancellationRequest], params: dict = {})
  • cancel_orders(self, ids: list[str], symbol: Str = None, params: dict = {})
  • close_position(self, symbol: str, side: Str = None, params: dict = {})
  • custom_handle_margin_mode_and_params(self, methodName: object, params: dict = {})
  • describe(self)
  • edit_order_request(self, id: str, symbol: Str, amount: Num, price: Num = None, params: dict = {})
  • edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params: dict = {})
  • nonce(self)
  • params_to_string(self, object: object, level: float)
  • withdraw(self, code: str, amount: float, address: str, params: dict = {})

REST Raw

  • base_public_get_v1_public_get_announcements(request)
  • v1_public_get_public_auth(request)
  • v1_public_get_public_get_instruments(request)
  • v1_public_get_public_get_book(request)
  • v1_public_get_public_get_candlestick(request)
  • v1_public_get_public_get_trades(request)
  • v1_public_get_public_get_tickers(request)
  • v1_public_get_public_get_valuations(request)
  • v1_public_get_public_get_expired_settlement_price(request)
  • v1_public_get_public_get_insurance(request)
  • v1_public_get_public_get_announcements(request)
  • v1_public_get_public_get_risk_parameters(request)
  • v1_public_post_public_staking_get_conversion_rate(request)
  • v1_private_post_private_set_cancel_on_disconnect(request)
  • v1_private_post_private_get_cancel_on_disconnect(request)
  • v1_private_post_private_user_balance(request)
  • v1_private_post_private_user_balance_history(request)
  • v1_private_post_private_get_positions(request)
  • v1_private_post_private_create_order(request)
  • v1_private_post_private_amend_order(request)
  • v1_private_post_private_create_order_list(request)
  • v1_private_post_private_cancel_order(request)
  • v1_private_post_private_cancel_order_list(request)
  • v1_private_post_private_cancel_all_orders(request)
  • v1_private_post_private_close_position(request)
  • v1_private_post_private_get_order_history(request)
  • v1_private_post_private_get_open_orders(request)
  • v1_private_post_private_get_order_detail(request)
  • v1_private_post_private_get_trades(request)
  • v1_private_post_private_change_account_leverage(request)
  • v1_private_post_private_get_transactions(request)
  • v1_private_post_private_create_subaccount_transfer(request)
  • v1_private_post_private_get_subaccount_balances(request)
  • v1_private_post_private_get_order_list(request)
  • v1_private_post_private_create_withdrawal(request)
  • v1_private_post_private_get_currency_networks(request)
  • v1_private_post_private_get_deposit_address(request)
  • v1_private_post_private_get_accounts(request)
  • v1_private_post_private_get_withdrawal_history(request)
  • v1_private_post_private_get_deposit_history(request)
  • v1_private_post_private_get_fee_rate(request)
  • v1_private_post_private_get_instrument_fee_rate(request)
  • v1_private_post_private_get_fee_credit_balances(request)
  • v1_private_post_private_fiat_fiat_deposit_info(request)
  • v1_private_post_private_fiat_fiat_deposit_history(request)
  • v1_private_post_private_fiat_fiat_withdraw_history(request)
  • v1_private_post_private_fiat_fiat_create_withdraw(request)
  • v1_private_post_private_fiat_fiat_transaction_quota(request)
  • v1_private_post_private_fiat_fiat_transaction_limit(request)
  • v1_private_post_private_fiat_fiat_get_bank_accounts(request)
  • v1_private_post_private_staking_stake(request)
  • v1_private_post_private_staking_unstake(request)
  • v1_private_post_private_staking_get_staking_position(request)
  • v1_private_post_private_staking_get_staking_instruments(request)
  • v1_private_post_private_staking_get_open_stake(request)
  • v1_private_post_private_staking_get_stake_history(request)
  • v1_private_post_private_staking_get_reward_history(request)
  • v1_private_post_private_staking_convert(request)
  • v1_private_post_private_staking_get_open_convert(request)
  • v1_private_post_private_staking_get_convert_history(request)
  • v1_private_post_private_create_isolated_margin_transfer(request)
  • v1_private_post_private_change_isolated_margin_leverage(request)
  • v1_private_post_private_bot_create_trading_bot(request)
  • v1_private_post_private_bot_update_trading_bot(request)
  • v1_private_post_private_bot_terminate_trading_bot(request)
  • v1_private_post_private_bot_pause_trading_bot(request)
  • v1_private_post_private_bot_resume_trading_bot(request)
  • v1_private_post_private_bot_get_trading_bots(request)
  • v1_private_post_private_bot_get_trading_bot_executions(request)
  • v2_public_get_public_auth(request)
  • v2_public_get_public_get_instruments(request)
  • v2_public_get_public_get_book(request)
  • v2_public_get_public_get_candlestick(request)
  • v2_public_get_public_get_ticker(request)
  • v2_public_get_public_get_trades(request)
  • v2_public_get_public_margin_get_transfer_currencies(request)
  • v2_public_get_public_margin_get_load_currenices(request)
  • v2_public_get_public_respond_heartbeat(request)
  • v2_private_post_private_set_cancel_on_disconnect(request)
  • v2_private_post_private_get_cancel_on_disconnect(request)
  • v2_private_post_private_create_withdrawal(request)
  • v2_private_post_private_get_withdrawal_history(request)
  • v2_private_post_private_get_currency_networks(request)
  • v2_private_post_private_get_deposit_history(request)
  • v2_private_post_private_get_deposit_address(request)
  • v2_private_post_private_export_create_export_request(request)
  • v2_private_post_private_export_get_export_requests(request)
  • v2_private_post_private_export_download_export_output(request)
  • v2_private_post_private_get_account_summary(request)
  • v2_private_post_private_create_order(request)
  • v2_private_post_private_cancel_order(request)
  • v2_private_post_private_cancel_all_orders(request)
  • v2_private_post_private_create_order_list(request)
  • v2_private_post_private_get_order_history(request)
  • v2_private_post_private_get_open_orders(request)
  • v2_private_post_private_get_order_detail(request)
  • v2_private_post_private_get_trades(request)
  • v2_private_post_private_get_accounts(request)
  • v2_private_post_private_get_subaccount_balances(request)
  • v2_private_post_private_create_subaccount_transfer(request)
  • v2_private_post_private_otc_get_otc_user(request)
  • v2_private_post_private_otc_get_instruments(request)
  • v2_private_post_private_otc_request_quote(request)
  • v2_private_post_private_otc_accept_quote(request)
  • v2_private_post_private_otc_get_quote_history(request)
  • v2_private_post_private_otc_get_trade_history(request)
  • v2_private_post_private_otc_create_order(request)
  • derivatives_public_get_public_auth(request)
  • derivatives_public_get_public_get_instruments(request)
  • derivatives_public_get_public_get_book(request)
  • derivatives_public_get_public_get_candlestick(request)
  • derivatives_public_get_public_get_trades(request)
  • derivatives_public_get_public_get_tickers(request)
  • derivatives_public_get_public_get_valuations(request)
  • derivatives_public_get_public_get_expired_settlement_price(request)
  • derivatives_public_get_public_get_insurance(request)
  • derivatives_private_post_private_set_cancel_on_disconnect(request)
  • derivatives_private_post_private_get_cancel_on_disconnect(request)
  • derivatives_private_post_private_user_balance(request)
  • derivatives_private_post_private_user_balance_history(request)
  • derivatives_private_post_private_get_positions(request)
  • derivatives_private_post_private_create_order(request)
  • derivatives_private_post_private_create_order_list(request)
  • derivatives_private_post_private_cancel_order(request)
  • derivatives_private_post_private_cancel_order_list(request)
  • derivatives_private_post_private_cancel_all_orders(request)
  • derivatives_private_post_private_close_position(request)
  • derivatives_private_post_private_convert_collateral(request)
  • derivatives_private_post_private_get_order_history(request)
  • derivatives_private_post_private_get_open_orders(request)
  • derivatives_private_post_private_get_order_detail(request)
  • derivatives_private_post_private_get_trades(request)
  • derivatives_private_post_private_change_account_leverage(request)
  • derivatives_private_post_private_get_transactions(request)
  • derivatives_private_post_private_create_subaccount_transfer(request)
  • derivatives_private_post_private_get_subaccount_balances(request)
  • derivatives_private_post_private_get_order_list(request)

WS Unified

  • describe(self)
  • pong(self, client: Client, message: dict)
  • watch_order_book(self, symbol: str, limit: Int = None, params: dict = {})
  • un_watch_order_book(self, symbol: str, params={})
  • watch_order_book_for_symbols(self, symbols: list[str], limit: Int = None, params: dict = {})
  • un_watch_order_book_for_symbols(self, symbols: list[str], params: dict = {})
  • watch_trades(self, symbol: str, since: Int = None, limit: Int = None, params: dict = {})
  • un_watch_trades(self, symbol: str, params: dict = {})
  • watch_trades_for_symbols(self, symbols: list[str], since: Int = None, limit: Int = None, params: dict = {})
  • un_watch_trades_for_symbols(self, symbols: list[str], params: dict = {})
  • watch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • watch_ticker(self, symbol: str, params: dict = {})
  • un_watch_ticker(self, symbol: str, params: dict = {})
  • watch_tickers(self, symbols: Strings = None, params: dict = {})
  • un_watch_tickers(self, symbols: Strings = None, params: dict = {})
  • watch_bids_asks(self, symbols: Strings = None, params: dict = {})
  • watch_ohlcv(self, symbol: str, timeframe: str = '1m', since: Int = None, limit: Int = None, params: dict = {})
  • un_watch_ohlcv(self, symbol: str, timeframe: str = '1m', params: dict = {})
  • watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params: dict = {})
  • watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params: dict = {})
  • set_positions_cache(self, client: Client, type: object, symbols: Strings = None)
  • load_positions_snapshot(self, client: Client, messageHash: str)
  • watch_balance(self, params: dict = {})
  • create_order_ws(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params: dict = {})
  • edit_order_ws(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params: dict = {})
  • cancel_order_ws(self, id: str, symbol: Str = None, params: dict = {})
  • cancel_all_orders_ws(self, symbol: Str = None, params: dict = {})
  • watch_public(self, messageHash: Str, params: dict = {})
  • watch_public_multiple(self, messageHashes: list[str], topics: list[str], params: dict = {})
  • un_watch_public_multiple(self, topic: str, symbols: list[str], messageHashes: list[str], subMessageHashes: list[str], topics: list[str], params: dict = {}, subExtend: dict = {})
  • watch_private_request(self, nonce: float, params: dict = {})
  • watch_private_subscribe(self, messageHash: Str, params: dict = {})
  • authenticate(self, params: dict = {})

Contribution

  • Give us a star ⭐
  • Fork and Clone! Awesome
  • Select existing issues or create a new issue.

Metadata

Release files for crypto-com-sdk 0.0.168

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crypto-com-sdk 0.0.168
File Size Uploaded Provenance
crypto_com_sdk-0.0.168.tar.gz 301.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for crypto-com-sdk 0.0.168
File Interpreter ABI Platform
crypto_com_sdk-0.0.168-py3-none-any.whl Python 3 none any Details

Total release size: 644.2 kB

Release files / crypto_com_sdk-0.0.168.tar.gz

Download URL crypto_com_sdk-0.0.168.tar.gz
Size 301.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0985cef7fa95cb439d48496a43499ab0adea7ac69891af96bc91edc3603fad9d
BLAKE2b-256 checksum
How to use checksums
591107cb430492e4440799cb21b2709c9569e1cfab0b34615cb974c32b067426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / crypto_com_sdk-0.0.168-py3-none-any.whl

Download URL crypto_com_sdk-0.0.168-py3-none-any.whl
Size 342.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b053171693e92e11e6e22d9a34041b869dfaf63750d121ee2e958ae561543e44
BLAKE2b-256 checksum
How to use checksums
5e41fc981bd377e0a9bd4f31e4fbaf9a8b247cff282e65cd599a81c95bdbb3ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for crypto-com-sdk 0.0.168

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.168 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page