### Install PySwyft via pip Source: https://github.com/mrteale/pyswyft/blob/main/README.md This command installs the PySwyft package using the Python package manager. It requires an active internet connection and a configured Python environment. ```bash pip install pyswyft ``` -------------------------------- ### Get Asset Market Information Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves basic or detailed market information for a specific asset. Use MarketsInfoBasic for summary data and MarketsInfoDetail for statistics and descriptions. ```python from pyswyft import API from pyswyft.endpoints.markets import MarketsInfoBasic, MarketsInfoDetail api = API(access_token='your_api_token', environment='demo') # Basic info request_basic = MarketsInfoBasic(asset_code='BTC') print(api.request(request_basic)) # Detailed info request_detail = MarketsInfoDetail(asset_code='ETH') print(api.request(request_detail)) ``` -------------------------------- ### Markets Live Rates API Source: https://context7.com/mrteale/pyswyft/llms.txt Get live trading rates for a specific cryptocurrency asset. ```APIDOC ## Markets Live Rates ### Description Get live trading rates for a specific cryptocurrency asset. ### Method POST ### Endpoint /markets/live_rates ### Parameters #### Request Body - **asset_code** (integer) - Required - The code of the asset for which to retrieve live rates. ### Request Example ```json { "asset_code": 3 } ``` ### Response #### Success Response (200) - **buy** (string) - The current buy price of the asset. - **sell** (string) - The current sell price of the asset. - **midPrice** (string) - The mid-price between buy and sell. #### Response Example ```json { "buy": "45000.00", "sell": "44950.00", "midPrice": "44975.00" } ``` ``` -------------------------------- ### Markets Info Basic API Source: https://context7.com/mrteale/pyswyft/llms.txt Get basic market information for a specific asset. ```APIDOC ## Markets Info Basic ### Description Get basic market information for a specific asset. ### Method GET ### Endpoint /markets/info/basic ### Parameters #### Query Parameters - **asset_code** (string) - Required - The code of the asset for which to retrieve basic information (e.g., 'BTC'). ### Response #### Success Response (200) - **code** (string) - The currency code for the asset. - **name** (string) - The name of the asset. - **rank** (integer) - The market rank of the asset. #### Response Example ```json { "code": "BTC", "name": "Bitcoin", "rank": 1 } ``` ``` -------------------------------- ### Markets Info Detail API Source: https://context7.com/mrteale/pyswyft/llms.txt Get detailed market information including price history and statistics for a specific asset. ```APIDOC ## Markets Info Detail ### Description Get detailed market information including price history and statistics for a specific asset. ### Method GET ### Endpoint /markets/info/detail ### Parameters #### Query Parameters - **asset_code** (string) - Required - The code of the asset for which to retrieve detailed information (e.g., 'ETH'). ### Response #### Success Response (200) - **code** (string) - The currency code for the asset. - **name** (string) - The name of the asset. - **description** (string) - A description of the asset. - **marketCap** (string) - The market capitalization of the asset. #### Response Example ```json { "code": "ETH", "name": "Ethereum", "description": "A decentralized platform that runs smart contracts.", "marketCap": "200000000000" } ``` ``` -------------------------------- ### Orders Get Order API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve details of a specific order by its ID. ```APIDOC ## Orders Get Order ### Description Retrieve details of a specific order by its ID. ### Method GET ### Endpoint /orders/{orderID} ### Parameters #### Path Parameters - **orderID** (string) - Required - The unique identifier of the order. ### Response #### Success Response (200) - **orderId** (string) - The unique identifier for the order. - **status** (string) - The current status of the order. - **type** (string) - The type of the order (e.g., 'market', 'limit'). #### Response Example ```json { "orderId": "order-uuid-12345", "status": "completed", "type": "market" } ``` ``` -------------------------------- ### Initialize PySwyft API Client Source: https://context7.com/mrteale/pyswyft/llms.txt Demonstrates how to initialize the API client for both demo and live trading environments using Bearer token authentication. It also shows usage with a context manager and custom headers/request parameters. ```python from pyswyft import API # Initialize client for demo environment (default) api = API(access_token='your_api_token', environment='demo') # Initialize client for live trading api = API(access_token='your_api_token', environment='live') # Using context manager for automatic cleanup with API(access_token='your_api_token', environment='demo') as api: # Make API calls here pass # With custom headers and request parameters api = API( access_token='your_api_token', environment='live', headers={'X-Custom-Header': 'value'}, request_params={'timeout': 30} ) ``` -------------------------------- ### Retrieve Account Promotions Source: https://context7.com/mrteale/pyswyft/llms.txt Fetches a list of available promotions for the user's account. Requires an initialized API client and the AccountPromotions endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountPromotions api = API(access_token='your_api_token', environment='demo') request = AccountPromotions() response = api.request(request) ``` -------------------------------- ### Orders Create API Source: https://context7.com/mrteale/pyswyft/llms.txt Create a new market or limit order to buy or sell cryptocurrency. ```APIDOC ## Orders Create ### Description Create a new market or limit order to buy or sell cryptocurrency. ### Method POST ### Endpoint /orders ### Parameters #### Request Body - **primary** (integer) - Required - The primary asset code (e.g., the currency you are spending). - **secondary** (integer) - Required - The secondary asset code (e.g., the currency you are buying). - **quantity** (number) - Required - The amount in the primary currency. - **assetQuantity** (number) - Required - The amount in the secondary currency. - **orderType** (integer) - Required - The type of order (1=market, 2=limit). - **trigger** (number) - Optional - The trigger or limit price for limit orders. ### Request Example ```json { "primary": 1, "secondary": 3, "quantity": 1000, "assetQuantity": 0.022, "orderType": 2, "trigger": 45000 } ``` ### Response #### Success Response (200) - **orderId** (string) - The unique identifier for the newly created order. - **status** (string) - The initial status of the order. #### Response Example ```json { "orderId": "new-order-uuid", "status": "pending" } ``` ``` -------------------------------- ### Retrieve Account Details Source: https://context7.com/mrteale/pyswyft/llms.txt Fetches basic account information for the authenticated user, including user ID and email. Requires an initialized API client and the AccountDetails endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountDetails api = API(access_token='your_api_token', environment='demo') # Get account details request = AccountDetails() response = api.request(request) print(response) # Expected output: {'user': {'id': 12345, 'email': 'user@example.com', ...}} ``` -------------------------------- ### Retrieve Live Market Rates Source: https://context7.com/mrteale/pyswyft/llms.txt Fetches current buy, sell, and mid-market prices for a specific asset. Requires an initialized API instance and an asset code. ```python from pyswyft import API from pyswyft.endpoints.markets import MarketsLiveRates api = API(access_token='your_api_token', environment='demo') # Get live rates for Bitcoin (asset code 3) request = MarketsLiveRates(asset_code=3) response = api.request(request) print(response) ``` -------------------------------- ### Convert Dust Balances with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Converts small balances (dust) of specified assets into a primary asset. Requires the primary asset ID and a list of asset IDs to convert from. ```python from pyswyft import API from pyswyft.endpoints.orders import OrdersDust api = API(access_token='your_api_token', environment='demo') # Convert dust balances to primary asset request = OrdersDust( primary=1, # Convert to AUD selected=[3, 5, 7] # Asset IDs to convert from ) response = api.request(request) ``` -------------------------------- ### Handle API Errors with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Demonstrates how to handle API errors using the PySwyftError exception class. Includes specific checks for common error codes like authentication and bad requests. ```python from pyswyft import API, PySwyftError from pyswyft.endpoints.orders import OrdersCreate api = API(access_token='your_api_token', environment='demo') try: request = OrdersCreate( primary=1, secondary=3, quantity=100, assetQuantity=0.002, orderType=1 ) response = api.request(request) except PySwyftError as e: print(f"API Error {e.code}: {e.message}") # Handle specific error codes if e.code == 401: print("Authentication failed - check your API token") elif e.code == 400: print("Bad request - check your parameters") elif e.code >= 500: print("Server error - try again later") except Exception as e: print(f"Unexpected error: {e}") ``` -------------------------------- ### Manage Orders Source: https://context7.com/mrteale/pyswyft/llms.txt Provides functionality to list, retrieve, create, and update orders. Supports pagination for listing and various order types for creation. ```python from pyswyft import API from pyswyft.endpoints.orders import OrdersListAll, OrdersGetOrder, OrdersCreate, OrdersUpdate api = API(access_token='your_api_token', environment='demo') # List orders print(api.request(OrdersListAll(asset_code=3, limit=10, page=1))) # Create order order = OrdersCreate(primary=1, secondary=3, quantity=100, assetQuantity=0.002, orderType=1) print(api.request(order)) ``` -------------------------------- ### Retrieve Affiliate History with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves affiliate commission and referral history. Supports pagination and sorting by date. ```python from pyswyft import API from pyswyft.endpoints.history import HistoryAffiliate api = API(access_token='your_api_token', environment='demo') request = HistoryAffiliate(limit=50, page=1, sortby='date') response = api.request(request) print(response) # Expected output: {'affiliates': [{'referralId': '...', 'commission': '5.00', ...}, ...]} ``` -------------------------------- ### Orders List All API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve all orders or orders for a specific asset with pagination support. ```APIDOC ## Orders List All ### Description Retrieve all orders or orders for a specific asset with pagination support. ### Method GET ### Endpoint /orders ### Parameters #### Query Parameters - **asset_code** (integer) - Optional - Filter orders by asset code. - **limit** (integer) - Optional - Number of orders to return per page. Defaults to 20. - **page** (integer) - Optional - Page number for pagination. Defaults to 1. ### Response #### Success Response (200) - **orders** (array) - A list of order objects. - **orderId** (string) - The unique identifier for the order. - **status** (string) - The current status of the order. - **total** (integer) - The total number of orders available. #### Response Example ```json { "orders": [ { "orderId": "order-uuid-123", "status": "completed" } ], "total": 50 } ``` ``` -------------------------------- ### Retrieve Account Affiliations Source: https://context7.com/mrteale/pyswyft/llms.txt Fetches affiliate information associated with the user's account. Requires an initialized API client and the AccountAffiliations endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountAffiliations api = API(access_token='your_api_token', environment='demo') request = AccountAffiliations() response = api.request(request) ``` -------------------------------- ### Retrieve Account Progress Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves information about the user's account progress and completion status. Requires an initialized API client and the AccountProgress endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountProgress api = API(access_token='your_api_token', environment='demo') request = AccountProgress() response = api.request(request) ``` -------------------------------- ### Retrieve Account Balance Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves the balance of all assets in the user's account. This includes asset IDs and available balances. Requires an initialized API client and the AccountBalance endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountBalance api = API(access_token='your_api_token', environment='demo') # Get all account balances request = AccountBalance() response = api.request(request) print(response) # Expected output: [{'assetId': 1, 'availableBalance': '1000.00', ...}, ...] ``` -------------------------------- ### Check Account Verification Info Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves the verification status of the user's account, including email and phone verification, and KYC level. Requires an initialized API client and the AccountVerificationInfo endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountVerificationInfo api = API(access_token='your_api_token', environment='demo') request = AccountVerificationInfo() response = api.request(request) print(response) # Expected output: {'emailVerified': True, 'phoneVerified': False, 'kycLevel': 2, ...} ``` -------------------------------- ### Update Account Settings Source: https://context7.com/mrteale/pyswyft/llms.txt Allows updating various user account settings, such as setting favorite assets, opting out of analytics, or toggling SMS recovery. Requires an initialized API client and the AccountSettings endpoint with specific parameters. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountSettings api = API(access_token='your_api_token', environment='demo') # Set a favorite asset request = AccountSettings(favouriteID=5, favouriteStatus=True) response = api.request(request) # Opt out of analytics request = AccountSettings(analyticsOptOut=True) response = api.request(request) # Toggle SMS recovery request = AccountSettings(toggleSMSRecovery=True) response = api.request(request) ``` -------------------------------- ### Markets Assets API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve a list of all available tradeable assets on the platform. ```APIDOC ## Markets Assets ### Description Retrieve a list of all available tradeable assets on the platform. ### Method GET ### Endpoint /markets/assets ### Response #### Success Response (200) - **id** (integer) - The unique identifier for the asset. - **code** (string) - The currency code for the asset. - **name** (string) - The name of the asset. #### Response Example ```json [ { "id": 1, "code": "AUD", "name": "Australian Dollar" } ] ``` ``` -------------------------------- ### Set Account Currency Source: https://context7.com/mrteale/pyswyft/llms.txt Sets the default display currency for the user's account. Requires an initialized API client and the AccountCurrency endpoint, specifying the asset number for the desired currency. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountCurrency api = API(access_token='your_api_token', environment='demo') # Set default currency to asset number 1 (typically AUD) request = AccountCurrency(asset_number=1) response = api.request(request) ``` -------------------------------- ### Orders Dust API Source: https://context7.com/mrteale/pyswyft/llms.txt Convert small balances (dust) to a primary asset. ```APIDOC ## POST /api/orders/dust ### Description Convert small balances (dust) to a primary asset. ### Method POST ### Endpoint /api/orders/dust ### Parameters #### Request Body - **primary** (integer) - Required - The asset code of the primary asset to convert to. - **selected** (array of integers) - Required - A list of asset IDs to convert from. ### Request Example ```json { "primary": 1, "selected": [3, 5, 7] } ``` ### Response #### Success Response (200) (Response structure not explicitly defined in the provided text, typically returns confirmation or details of the conversion.) ``` -------------------------------- ### List Tradeable Assets Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves a list of all assets available for trading on the platform. Returns a list of asset objects containing IDs and codes. ```python from pyswyft import API from pyswyft.endpoints.markets import MarketsAssets api = API(access_token='your_api_token', environment='demo') request = MarketsAssets() response = api.request(request) print(response) ``` -------------------------------- ### Calculate Order Exchange Rates Source: https://context7.com/mrteale/pyswyft/llms.txt Calculates the exchange rate between two assets for a given amount. Supports optional limit pricing for order estimation. ```python from pyswyft import API from pyswyft.endpoints.orders import OrdersExchangeRate api = API(access_token='your_api_token', environment='demo') # Get exchange rate for buying BTC with AUD request = OrdersExchangeRate(buy=3, sell=1, amount=1000) response = api.request(request) print(response) ``` -------------------------------- ### Retrieve Account Statistics Source: https://context7.com/mrteale/pyswyft/llms.txt Fetches trading statistics for the authenticated user, including total trades and volume. Requires an initialized API client and the AccountStatistics endpoint. ```python from pyswyft import API from pyswyft.endpoints.accounts import AccountStatistics api = API(access_token='your_api_token', environment='demo') request = AccountStatistics() response = api.request(request) print(response) # Expected output: {'totalTrades': 150, 'totalVolume': '50000.00', ...} ``` -------------------------------- ### Orders Exchange Rate API Source: https://context7.com/mrteale/pyswyft/llms.txt Calculate exchange rates between two assets before placing an order. ```APIDOC ## Orders Exchange Rate ### Description Calculate exchange rates between two assets before placing an order. ### Method POST ### Endpoint /orders/exchange_rate ### Parameters #### Request Body - **buy** (integer) - Required - The asset code to buy. - **sell** (integer) - Required - The asset code to sell. - **amount** (number) - Required - The amount of the 'sell' asset to exchange. - **limit** (number) - Optional - The limit price for the exchange. ### Request Example ```json { "buy": 3, "sell": 1, "amount": 1000, "limit": 45000 } ``` ### Response #### Success Response (200) - **rate** (string) - The exchange rate. - **amount** (string) - The calculated amount of the 'buy' asset. - **total** (string) - The total amount of the 'sell' asset. #### Response Example ```json { "rate": "0.00002222", "amount": "0.02222", "total": "1000" } ``` ``` -------------------------------- ### History Affiliate API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve affiliate commission and referral history. ```APIDOC ## GET /api/history/affiliate ### Description Retrieve affiliate commission and referral history. ### Method GET ### Endpoint /api/history/affiliate ### Parameters #### Query Parameters - **limit** (integer) - Optional - The number of results to return per page. Defaults to 50. - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **sortby** (string) - Optional - The field to sort the results by. Common values include 'date'. ### Response #### Success Response (200) - **affiliates** (array) - A list of affiliate commission and referral objects. - **referralId** (string) - The ID of the referral. - **commission** (string) - The commission amount. - ... (other relevant fields) #### Response Example ```json { "affiliates": [ { "referralId": "...", "commission": "5.00", ... }, ... ] } ``` ``` -------------------------------- ### Orders Update API Source: https://context7.com/mrteale/pyswyft/llms.txt Update an existing open order. ```APIDOC ## Orders Update ### Description Update an existing open order. ### Method PUT ### Endpoint /orders/{orderID} ### Parameters #### Path Parameters - **orderID** (string) - Required - The unique identifier of the order to update. #### Request Body - **quantity** (number) - Optional - The updated amount in the primary currency. - **assetQuantity** (number) - Optional - The updated amount in the secondary currency. - **trigger** (number) - Optional - The updated trigger or limit price. ### Request Example ```json { "quantity": 1500, "assetQuantity": 0.033, "trigger": 46000 } ``` ### Response #### Success Response (200) - **orderId** (string) - The unique identifier for the updated order. - **status** (string) - The updated status of the order. #### Response Example ```json { "orderId": "order-uuid-12345", "status": "updated" } ``` ``` -------------------------------- ### Retrieve Deposit History with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves deposit history, either for a specific asset or for all assets. Supports filtering by asset code, limit, page, and sort order. ```python from pyswyft import API from pyswyft.endpoints.history import HistoryCurrencyDeposit, HistoryAllDeposit api = API(access_token='your_api_token', environment='demo') # Get deposit history for a specific asset request = HistoryCurrencyDeposit(asset_code=1, limit=20, page=1, sortby='date') response = api.request(request) # Get all deposit history request = HistoryAllDeposit(limit=50, page=1, sortby='date') response = api.request(request) print(response) # Expected output: {'deposits': [{'id': '...', 'amount': '1000.00', 'status': 'completed', ...}, ...]} ``` -------------------------------- ### Retrieve Complete Transaction History with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves the complete transaction history, allowing filtering by transaction type, asset ID, limit, page, and sort order. ```python from pyswyft import API from pyswyft.endpoints.history import HistoryAll api = API(access_token='your_api_token', environment='demo') # Get all history for a specific type and asset request = HistoryAll( type='trade', # Transaction type assetId=3, # Asset ID limit=100, page=1, sortby='date' ) response = api.request(request) print(response) # Expected output: {'transactions': [{'type': 'trade', 'amount': '0.01', ...}, ...], 'total': 250} ``` -------------------------------- ### Error Handling Source: https://context7.com/mrteale/pyswyft/llms.txt Handle API errors using the PySwyftError exception class. ```APIDOC ## Error Handling ### Description Handle API errors using the PySwyftError exception class. ### Method N/A (This describes error handling for various API calls) ### Endpoint N/A ### Parameters N/A ### Request Example ```python from pyswyft import API, PySwyftError from pyswyft.endpoints.orders import OrdersCreate api = API(access_token='your_api_token', environment='demo') try: request = OrdersCreate( primary=1, secondary=3, quantity=100, assetQuantity=0.002, orderType=1 ) response = api.request(request) except PySwyftError as e: print(f"API Error {e.code}: {e.message}") # Handle specific error codes if e.code == 401: print("Authentication failed - check your API token") elif e.code == 400: print("Bad request - check your parameters") elif e.code >= 500: print("Server error - try again later") except Exception as e: print(f"Unexpected error: {e}") ``` ### Response #### Error Responses - **PySwyftError** (object) - Represents an error returned by the API. - **code** (integer) - The HTTP status code or a custom error code. - **message** (string) - A human-readable description of the error. #### Error Example ``` API Error 401: Authentication failed - check your API token ``` ``` -------------------------------- ### History Deposit API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve deposit history for a specific asset or all assets. ```APIDOC ## GET /api/history/deposit ### Description Retrieve deposit history for a specific asset or all assets. ### Method GET ### Endpoint /api/history/deposit ### Parameters #### Query Parameters - **asset_code** (integer) - Optional - Filter history for a specific asset. - **limit** (integer) - Optional - The number of results to return per page. Defaults to 20. - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **sortby** (string) - Optional - The field to sort the results by. Common values include 'date'. ### Response #### Success Response (200) - **deposits** (array) - A list of deposit objects. - **id** (string) - The unique identifier for the deposit. - **amount** (string) - The amount deposited. - **status** (string) - The status of the deposit (e.g., 'completed'). - ... (other relevant fields) #### Response Example ```json { "deposits": [ { "id": "...", "amount": "1000.00", "status": "completed", ... }, ... ] } ``` ``` -------------------------------- ### History All API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve complete transaction history filtered by type and asset. ```APIDOC ## GET /api/history/all ### Description Retrieve complete transaction history filtered by type and asset. ### Method GET ### Endpoint /api/history/all ### Parameters #### Query Parameters - **type** (string) - Optional - Filter history by transaction type (e.g., 'trade'). - **assetId** (integer) - Optional - Filter history for a specific asset ID. - **limit** (integer) - Optional - The number of results to return per page. Defaults to 50. - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **sortby** (string) - Optional - The field to sort the results by. Common values include 'date'. ### Response #### Success Response (200) - **transactions** (array) - A list of transaction objects. - **type** (string) - The type of transaction. - **amount** (string) - The amount of the transaction. - ... (other relevant fields) - **total** (integer) - The total number of transactions available. #### Response Example ```json { "transactions": [ { "type": "trade", "amount": "0.01", ... }, ... ], "total": 250 } ``` ``` -------------------------------- ### Cancel Order with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Cancels an open order by its unique ID. Requires an API client instance and the order ID. Returns the status of the cancellation. ```python from pyswyft import API from pyswyft.endpoints.orders import OrdersCancel api = API(access_token='your_api_token', environment='demo') # Cancel an order request = OrdersCancel(orderID='order-uuid-12345') response = api.request(request) print(response) # Expected output: {'orderId': 'order-uuid-12345', 'status': 'cancelled'} ``` -------------------------------- ### Retrieve Withdrawal History with PySwyft Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieves withdrawal history, either for a specific asset or for all assets. Supports filtering by asset code, limit, page, and sort order. ```python from pyswyft import API from pyswyft.endpoints.history import HistoryCurrencyWithdraw, HistoryAllWithdraw api = API(access_token='your_api_token', environment='demo') # Get withdrawal history for a specific asset request = HistoryCurrencyWithdraw(asset_code=3, limit=20, page=1, sortby='date') response = api.request(request) # Get all withdrawal history request = HistoryAllWithdraw(limit=50, page=1, sortby='date') response = api.request(request) print(response) # Expected output: {'withdrawals': [{'id': '...', 'amount': '0.5', 'status': 'completed', ...}, ...]} ``` -------------------------------- ### History Withdraw API Source: https://context7.com/mrteale/pyswyft/llms.txt Retrieve withdrawal history for a specific asset or all assets. ```APIDOC ## GET /api/history/withdraw ### Description Retrieve withdrawal history for a specific asset or all assets. ### Method GET ### Endpoint /api/history/withdraw ### Parameters #### Query Parameters - **asset_code** (integer) - Optional - Filter history for a specific asset. - **limit** (integer) - Optional - The number of results to return per page. Defaults to 20. - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **sortby** (string) - Optional - The field to sort the results by. Common values include 'date'. ### Response #### Success Response (200) - **withdrawals** (array) - A list of withdrawal objects. - **id** (string) - The unique identifier for the withdrawal. - **amount** (string) - The amount withdrawn. - **status** (string) - The status of the withdrawal (e.g., 'completed'). - ... (other relevant fields) #### Response Example ```json { "withdrawals": [ { "id": "...", "amount": "0.5", "status": "completed", ... }, ... ] } ``` ``` -------------------------------- ### Orders Cancel API Source: https://context7.com/mrteale/pyswyft/llms.txt Cancel an open order by its ID. ```APIDOC ## POST /api/orders/cancel ### Description Cancel an open order by its ID. ### Method POST ### Endpoint /api/orders/cancel ### Parameters #### Request Body - **orderID** (string) - Required - The unique identifier of the order to cancel. ### Request Example ```json { "orderID": "order-uuid-12345" } ``` ### Response #### Success Response (200) - **orderId** (string) - The ID of the cancelled order. - **status** (string) - The status of the order, which should be 'cancelled'. #### Response Example ```json { "orderId": "order-uuid-12345", "status": "cancelled" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.