### Get Beneficiaries Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of beneficiaries, with an option to filter by state. ```APIDOC ## GET /trade/account/beneficiaries ### Description Get list of beneficiaries ### Method GET ### Endpoint /trade/account/beneficiaries ### Parameters #### Query Parameters - **state** (string) - Optional - Filter beneficiaries by state. Allowed values: "pending", "active", "disabled" #### Request Body ### Request Example ### Response #### Success Response (200) - **[Array of beneficiary objects]** (array) - List of beneficiaries matching the filter criteria. #### Response Example ```json [ { "id": "string", "name": "string", "state": "string", "created_at": "string" } ] ``` #### Error Response (400) - **error** (object) - Details about the bad request #### Response Example ```json { "error": { "code": "string", "message": "string", "details": "string" } } ``` #### Error Response (401) - **error** (object) - Details about the unauthorized access #### Response Example ```json { "error": { "code": "string", "message": "string", "details": "string" } } ``` #### Error Response (404) - **error** (object) - Details if the record is not found #### Response Example ```json { "error": { "code": "string", "message": "string", "details": "string" } } ``` #### Error Response (500) - **error** (object) - Details about the internal server error #### Response Example ```json { "error": { "code": "string", "message": "string", "details": "string" } } ``` ``` -------------------------------- ### Get List of Spot Accounts Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of spot accounts associated with the user's account. ```APIDOC ## GET /trade/account/balances/spot ### Description Get list of spot accounts ### Method GET ### Endpoint /trade/account/balances/spot ### Parameters #### Query Parameters #### Request Body ### Request Example ### Response #### Success Response (200) - **items** (array) - List of spot accounts #### Response Example ```json [ { "market_id": { "type": "string" }, "taker": { "type": "number" } } ] ``` #### Error Response (500) - **error** (object) - Details about the internal server error #### Response Example ```json { "error": { "code": "string", "message": "string", "details": "string" } } ``` ``` -------------------------------- ### GET /trade/public/currencies Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a complete list of all available currencies in the SafeTrade system. Returns information about all supported trading currencies with their properties and configurations. ```APIDOC ## GET /trade/public/currencies ### Description Retrieve a list of all available currencies supported by the SafeTrade API. ### Method GET ### Endpoint /trade/public/currencies ### Response #### Success Response (200) - **currencies** (array of Currency objects) - List of all available currencies with their information #### Response Example [ { "id": "usdt", "name": "Tether", "symbol": "USDT" }, { "id": "btc", "name": "Bitcoin", "symbol": "BTC" } ] #### Error Response (500) - **error** (Error object) - Internal Server Error details ``` -------------------------------- ### GET /trade/public/markets Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of all available markets on the Safetrade platform. This endpoint provides general information about each market. ```APIDOC ## GET /trade/public/markets ### Description Retrieves a list of all available markets on the Safetrade platform. This endpoint provides general information about each market. ### Method GET ### Endpoint /trade/public/markets ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **array** - An array of market objects, each containing market information. #### Response Example ```json [ { "id": "btcusdt", "name": "Bitcoin / USDT", "base_currency": "BTC", "quote_currency": "USDT", "fee_ticker": "0.1%", "maker_fee": "0.001", "taker_fee": "0.002" } ] ``` ``` -------------------------------- ### GET /trade/market/orders Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of market orders. Supports filtering by market and side, and pagination. ```APIDOC ## GET /trade/market/orders ### Description Retrieves a list of market orders. Supports filtering by market and side, and pagination. ### Method GET ### Endpoint /trade/market/orders ### Parameters #### Query Parameters - **market** (string) - Optional - Such as 'btcusdt' - **side** (array of strings) - Optional - Side includes: buy, sell - **page** (integer) - Optional - Page number, defaults to 1 ### Response #### Success Response (200) - **orders** (array) - List of order objects. #### Response Example ```json { "orders": [ { "id": 123, "market": "btcusdt", "side": "buy", "price": "10000.00", "amount": "0.1", "status": "open" } ] } ``` #### Error Response (500) - **error** (object) - Contains error details. #### Error Response Example ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` ``` -------------------------------- ### GET /websocket/public Source: https://safetrade.com/api/v2/trade/public/swagger Establishes a public WebSocket connection for real-time market data. Requires subscription after connection to receive updates on public market information. ```APIDOC ## GET /websocket/public ### Description Establishes a public WebSocket connection for accessing real-time market data. Users must subscribe after connecting to receive data. ### Method GET ### Endpoint /websocket/public ### Parameters #### Request Body - **Message** (WebsocketMessage) - Required - Subscription message - Schema reference: entities.WebsocketMessage ### Response #### Success Response (200) - **data** (string) - The data returned is based on your subscription #### Error Response (500) - **error** (object) - Internal Server Error details ### Content-Type application/json ### Tags Websocket ### Notes After connecting to the WebSocket, you must send a subscription message to start receiving real-time updates. ``` -------------------------------- ### GET /trade/public/tickers/{market} Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves ticker information for a specific market. ```APIDOC ## GET /trade/public/tickers/{market} ### Description Retrieves ticker information for a specific market. ### Method GET ### Endpoint /trade/public/tickers/{market} ### Parameters #### Path Parameters - **market** (string) - Required - The market ID (e.g., 'btcusdt'). ### Response #### Success Response (200) - A ticker object for the specified market. #### Response Example ```json { "ask": "24050.00", "bid": "24040.00", "last": "24045.00", "high": "24200.00", "low": "23800.00", "volume": "5000.00", "timestamp": 1678886580000 } ``` #### Error Response (500) - Internal Server Error - Schema: #/definitions/pkg.Error ``` -------------------------------- ### GET /api/v2/accounts Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of user accounts. This endpoint provides details about all accounts associated with the user, including their balance, currency, and deposit addresses. ```APIDOC ## GET /api/v2/accounts ### Description Retrieves a list of user accounts. This endpoint provides details about all accounts associated with the user, including their balance, currency, and deposit addresses. ### Method GET ### Endpoint /api/v2/accounts ### Parameters No parameters required for this endpoint. ### Request Example ```json (No request body for GET requests) ``` ### Response #### Success Response (200) - **accounts** (array) - A list of account objects. - **balance** (number) - The current balance of the account. - **currency** (string) - The currency of the account. - **deposit_addresses** (array) - A list of deposit addresses for the account. - **locked** (number) - The amount of locked funds in the account. - **type** (string) - The type of the account. #### Response Example ```json { "accounts": [ { "balance": 100.50, "currency": "USD", "deposit_addresses": [ { "address": "0x123abc...", "currencies": ["ETH", "USDT"] } ], "locked": 10.00, "type": "spot" } ] } ``` ``` -------------------------------- ### GET /trade/account/deposits Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of deposit transactions. Supports filtering and sorting. ```APIDOC ## GET /trade/account/deposits ### Description Retrieves a list of deposit transactions associated with the account. This endpoint allows for filtering by currency and pagination. ### Method GET ### Endpoint /trade/account/deposits ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. Defaults to 100. - **order_by** (string) - Optional - Specifies the field to order the results by. - **ordering** (string) - Optional - The order direction for the results. Must be 'asc' or 'desc'. - **time_from** (string) - Optional - Unix second timestamp to filter deposits from. - **time_to** (string) - Optional - Unix second timestamp to filter deposits to. ### Request Example ```json { "limit": 50, "order_by": "created_at", "ordering": "desc", "time_from": "1691239429", "time_to": "1691325829" } ``` ### Response #### Success Response (200) - **items** (array) - An array of deposit objects. - Each deposit object contains details such as transaction ID, amount, currency, status, and timestamps. #### Response Example ```json { "items": [ { "txid": "tx123abc", "amount": "1.00000000", "currency": "USDT", "status": "succeed", "created_at": "2023-08-05T10:00:00Z", "updated_at": "2023-08-05T10:05:00Z" } ] } ``` #### Error Response (500) - **code** (integer) - Error code. - **message** (string) - Error message. ``` -------------------------------- ### GET /trade/market/orders/{id} Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves details for a specific market order by its ID. ```APIDOC ## GET /trade/market/orders/{id} ### Description Retrieves details for a specific market order by its ID. ### Method GET ### Endpoint /trade/market/orders/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the order to retrieve. ### Response #### Success Response (200) - **order** (object) - The order details. See `market_entities.Order` definition. #### Response Example ```json { "order": { "id": 123, "market": "btcusdt", "side": "buy", "price": "10000.00", "amount": "0.1", "status": "open" } } ``` #### Error Response (500) - **error** (object) - Contains error details. #### Error Response Example ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` ``` -------------------------------- ### GET /trade/account/members/me Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves information about the currently authenticated user's account. ```APIDOC ## GET /trade/account/members/me ### Description Retrieves the profile and account information for the currently logged-in user. ### Method GET ### Endpoint /trade/account/members/me ### Response #### Success Response (200) - **member_info** (object) - An object containing the member's details. - This object includes fields such as user ID, username, email, registration date, and account status. #### Response Example ```json { "user_id": "user987xyz", "username": "example_user", "email": "user@example.com", "registered_at": "2022-01-15T09:00:00Z", "account_status": "active" } ``` #### Error Response (500) - **code** (integer) - Error code. - **message** (string) - Error message. ``` -------------------------------- ### GET /trade/account/beneficiaries Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of beneficiaries associated with the user account. Supports filtering by blockchain key and currency ID, with pagination support. ```APIDOC ## GET /trade/account/beneficiaries ### Description Retrrieves a paginated list of account beneficiaries with optional filtering by blockchain and currency. ### Method GET ### Endpoint /trade/account/beneficiaries ### Parameters #### Query Parameters - **blockchain_key** (string) - Optional - Blockchain Key for filtering beneficiaries - **currency_id** (string) - Optional - Currency identifier (e.g., 'usdt') - **page** (integer) - Optional - Page number for pagination (default: 1) - **limit** (integer) - Optional - Number of results per page (default: 100) ### Response #### Success Response (200) - **items** (array) - Array of beneficiary objects - Each item contains beneficiary entity information #### Response Example [ { "id": "ben_123", "name": "Primary Beneficiary", "blockchain_key": "ethereum", "currency_id": "usdt" } ] #### Error Response (500) - **error** (object) - Internal Server Error details ``` -------------------------------- ### GET /trade/public/tickers Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves ticker information for all markets. The response is an object where keys are market names and values are ticker details. ```APIDOC ## GET /trade/public/tickers ### Description Retrieves ticker information for all markets. The response is an object where keys are market names and values are ticker details. ### Method GET ### Endpoint /trade/public/tickers ### Parameters (No parameters) ### Response #### Success Response (200) - An object containing ticker information for each market. #### Response Example ```json { "btcusdt": { "ask": "24050.00", "bid": "24040.00", "last": "24045.00", "high": "24200.00", "low": "23800.00", "volume": "5000.00", "timestamp": 1678886580000 }, "ethusdt": { "ask": "1600.00", "bid": "1595.00", "last": "1598.00", "high": "1610.00", "low": "1580.00", "volume": "10000.00", "timestamp": 1678886580000 } } ``` #### Error Response (500) - Internal Server Error - Schema: #/definitions/pkg.Error ``` -------------------------------- ### GET /trade/market/trades Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of market trades. Supports filtering by market and side, and pagination. ```APIDOC ## GET /trade/market/trades ### Description Retrieves a list of market trades. Supports filtering by market and side, and pagination. ### Method GET ### Endpoint /trade/market/trades ### Parameters #### Query Parameters - **market** (string) - Optional - Such as 'btcusdt' - **side** (array of strings) - Optional - Side includes: buy, sell - **page** (integer) - Optional - Page number, defaults to 1 ### Response #### Success Response (200) - **trades** (array) - List of trade objects. #### Response Example ```json { "trades": [ { "id": 456, "market": "btcusdt", "side": "buy", "price": "10010.00", "amount": "0.01", "timestamp": "2023-10-27T10:00:00Z" } ] } ``` #### Error Response (500) - **error** (object) - Contains error details. #### Error Response Example ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` ``` -------------------------------- ### GET /api/v2/beneficiary Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of saved beneficiaries. This endpoint lists all beneficiaries previously added by the user, along with their details. ```APIDOC ## GET /api/v2/beneficiary ### Description Retrieves a list of saved beneficiaries. This endpoint lists all beneficiaries previously added by the user, along with their details. ### Method GET ### Endpoint /api/v2/beneficiary ### Parameters No parameters required for this endpoint. ### Request Example ```json (No request body for GET requests) ``` ### Response #### Success Response (200) - **beneficiaries** (array) - A list of beneficiary objects. - **id** (integer) - The unique identifier for the beneficiary. - **blockchain_key** (string) - The key identifying the blockchain network. - **currency_id** (string) - The ID of the currency. - **address** (string) - The beneficiary's address. - **label** (string) - The label of the beneficiary. - **description** (string) - The description of the beneficiary. - **created_at** (string) - Timestamp when the beneficiary was created. - **updated_at** (string) - Timestamp when the beneficiary was last updated. - **state** (string) - The state of the beneficiary. #### Response Example ```json { "beneficiaries": [ { "id": 54321, "blockchain_key": "eth", "currency_id": "ETH", "address": "0x123abc...", "label": "My ETH Wallet", "description": "Main personal wallet", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z", "state": "active" } ] } ``` ``` -------------------------------- ### GET /trade/account/deposits Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves the deposit history for the account with support for filtering by currency, status, and blockchain. Includes pagination for managing large result sets. ```APIDOC ## GET /trade/account/deposits ### Description Retrieves a paginated list of deposits with optional filtering by currency, status, and blockchain. ### Method GET ### Endpoint /trade/account/deposits ### Parameters #### Query Parameters - **currency** (string) - Optional - Currency identifier (e.g., 'usdt') - **status** (string) - Optional - Deposit status. Allowed values: submitted, canceled, rejected, accepted, processing, skipped, collecting, collected, fee_collecting, fee_processing, fee_collected, errored - **blockchain_key** (string) - Optional - Blockchain Key for filtering deposits - **page** (integer) - Optional - Page number for pagination (default: 1) - **limit** (integer) - Optional - Number of results per page ### Response #### Success Response (200) - **items** (array) - Array of deposit transaction objects - **id** (string) - Deposit transaction ID - **currency** (string) - Currency identifier - **amount** (number) - Deposit amount - **status** (string) - Current deposit status - **blockchain_key** (string) - Blockchain identifier - **created_at** (string) - Timestamp of deposit creation #### Error Response (500) - **error** (object) - Internal Server Error details ``` -------------------------------- ### GET /trade/public/currencies/{id} Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves detailed information about a specific currency by its identifier. Returns comprehensive currency data including exchange rates, properties, and configuration details. ```APIDOC ## GET /trade/public/currencies/{id} ### Description Retrieve detailed information about a specific currency by its unique identifier. ### Method GET ### Endpoint /trade/public/currencies/{id} ### Path Parameters - **id** (string) - Required - Currency identifier (e.g., 'usdt', 'btc') ### Response #### Success Response (200) - **currency** (Currency object) - Complete currency information and properties #### Response Example { "id": "usdt", "name": "Tether", "symbol": "USDT", "decimals": 6 } #### Error Response (500) - **error** (Error object) - Internal Server Error details ``` -------------------------------- ### GET /api/v2/deposit Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of deposits. This endpoint allows users to view their deposit history, including details like amount, currency, transaction ID, and completion status. ```APIDOC ## GET /api/v2/deposit ### Description Retrieves a list of deposits. This endpoint allows users to view their deposit history, including details like amount, currency, transaction ID, and completion status. ### Method GET ### Endpoint /api/v2/deposit ### Parameters No parameters required for this endpoint. ### Request Example ```json (No request body for GET requests) ``` ### Response #### Success Response (200) - **deposits** (array) - A list of deposit objects. - **id** (integer) - The unique identifier for the deposit. - **amount** (number) - The deposited amount. - **currency** (string) - The currency of the deposit. - **blockchain_key** (string) - The key identifying the blockchain network. - **txid** (string) - The transaction ID of the deposit. - **from_address** (string) - The address from which the deposit was made. - **status** (string) - The status of the deposit (e.g., 'confirmed', 'pending'). - **created_at** (string) - Timestamp when the deposit was created. - **completed_at** (string) - Timestamp when the deposit was completed. - **updated_at** (string) - Timestamp when the deposit was last updated. #### Response Example ```json { "deposits": [ { "id": 98765, "amount": 0.5, "currency": "BTC", "blockchain_key": "btc", "txid": "a1b2c3d4e5f6...", "from_address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2", "status": "confirmed", "created_at": "2023-10-27T11:00:00Z", "completed_at": "2023-10-27T11:15:00Z", "updated_at": "2023-10-27T11:15:00Z" } ] } ``` ``` -------------------------------- ### GET /websocket/private Source: https://safetrade.com/api/v2/trade/public/swagger Establishes a private WebSocket connection for authenticated users. Requires subscription after connection to receive real-time data. Only accessible to authenticated users. ```APIDOC ## GET /websocket/private ### Description Establishes a private WebSocket connection for authenticated users. After connecting, users must subscribe to receive real-time data. ### Method GET ### Endpoint /websocket/private ### Authentication Required - This endpoint is only available to authenticated users. ### Parameters #### Request Body - **Message** (WebsocketMessage) - Required - Subscription message - Schema reference: entities.WebsocketMessage ### Response #### Success Response (200) - **data** (string) - The data returned is based on your subscription #### Error Response (500) - **error** (object) - Internal Server Error details ### Content-Type application/json ### Tags Websocket ### Notes After connecting to the WebSocket, you must send a subscription message to receive data. ``` -------------------------------- ### GET /trade/public/markets/{id} Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves detailed information for a specific market identified by its ID. This includes base currency, quote currency, and fee details. ```APIDOC ## GET /trade/public/markets/{id} ### Description Retrieves detailed information for a specific market identified by its ID. This includes base currency, quote currency, and fee details. ### Method GET ### Endpoint /trade/public/markets/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the market (e.g., 'btcusdt'). #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **object** - An object containing detailed information about the specified market. #### Response Example ```json { "id": "btcusdt", "name": "Bitcoin / USDT", "base_currency": "BTC", "quote_currency": "USDT", "fee_ticker": "0.1%", "maker_fee": "0.001", "taker_fee": "0.002" } ``` ``` -------------------------------- ### GET /trade/market/orders Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of market orders based on specified filters. You can filter by market, state, type, side, units, pagination, and time range. ```APIDOC ## GET /trade/market/orders ### Description Retrieves a list of market orders with various filtering options. ### Method GET ### Endpoint /trade/market/orders ### Parameters #### Query Parameters - **market** (string) - Optional - Filters orders by market symbol (e.g., 'btcusdt'). - **state** (array of strings) - Optional - Filters orders by state. Possible values: 'rejected', 'cancel', 'pending', 'wait', 'done'. - **type** (array of strings) - Optional - Filters orders by type. Possible values: 'limit', 'market', 'market_quote', 'stop_limit'. - **side** (array of strings) - Optional - Filters orders by side. Possible values: 'buy', 'sell'. - **base_unit** (string) - Optional - Filters orders by base currency unit. - **quote_unit** (string) - Optional - Filters orders by quote currency unit. - **page** (integer) - Optional - Specifies the page number for pagination. Defaults to 1. - **limit** (integer) - Optional - Specifies the number of results per page. Defaults to 100. - **order_by** (string) - Optional - Specifies the field to order the results by. - **ordering** (string) - Optional - Specifies the order direction ('asc' or 'desc'). - **time_from** (string) - Optional - Unix second timestamp to filter orders from. - **time_to** (string) - Optional - Unix second timestamp to filter orders until. ### Response #### Success Response (200) - **(array of Order objects)** - A list of market order objects. - **Order object properties**: (Details of Order object schema not provided in input) #### Response Example ```json [ { "id": "123e4567-e89b-12d3-a456-426614174000", "market": "btcusdt", "type": "limit", "side": "buy", "amount": "0.001", "price": "50000.00", "state": "done", "createdAt": "2023-08-01T10:00:00Z", "updatedAt": "2023-08-01T10:05:00Z" } ] ``` ``` -------------------------------- ### GET /trade/account/deposit_address/{currency_id} Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves the deposit address for a specific currency and network. Required for users to generate deposit addresses for cryptocurrency transactions. ```APIDOC ## GET /trade/account/deposit_address/{currency_id} ### Description Retrieves the deposit address for a specified cryptocurrency and network. ### Method GET ### Endpoint /trade/account/deposit_address/{currency_id} ### Parameters #### Path Parameters - **currency_id** (string) - Required - Currency identifier (e.g., 'usdt') #### Query Parameters - **network** (string) - Required - Network name for the deposit address ### Response #### Success Response (200) - **address** (string) - The deposit address for the specified currency and network - **currency_id** (string) - Currency identifier - **network** (string) - Network identifier #### Response Example { "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f1234a", "currency_id": "usdt", "network": "ethereum" } #### Error Response (500) - **error** (object) - Internal Server Error details ``` -------------------------------- ### GET /trade/public/trading_fees Source: https://safetrade.com/api/v2/trade/public/swagger Retrieve trading fees for a specific market or group. Supports pagination and custom sorting options. Returns a list of trading fee objects with configurable ordering. ```APIDOC ## GET /trade/public/trading_fees ### Description Retrieves trading fees for a specified market or group with pagination and sorting capabilities. ### Method GET ### Endpoint /trade/public/trading_fees ### Parameters #### Query Parameters - **market_id** (string) - Optional - Market identifier, such as 'btcusdt' - **group** (string) - Optional - Group filter - **page** (integer) - Optional - Page number (default: 1) - **limit** (integer) - Optional - Number of results per page (default: 100) - **order_by** (string) - Optional - Field to order results by - **ordering** (string) - Optional - Sort direction: 'asc' or 'desc' ### Response #### Success Response (200) - **items** (array) - List of trading fee objects - Each item contains trading fee information from public_entities.TradingFee #### Response Example [ { "market_id": "btcusdt", "fee": 0.001 } ] #### Error Response (500) - **error** (object) - Internal Server Error details ### Content-Type application/json ### Tags Public ``` -------------------------------- ### GET /trade/account/withdraws Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a paginated list of withdrawals with optional filtering by status, blockchain key, and time range. Supports sorting and ordering parameters for flexible data retrieval. ```APIDOC ## GET /trade/account/withdraws ### Description Retrieve a list of withdrawals from the user's account with optional filtering, pagination, and sorting capabilities. ### Method GET ### Endpoint /trade/account/withdraws ### Parameters #### Query Parameters - **status** (string) - Optional - Withdrawal status filter. Allowed values: "pending", "success", "failed", "errored", "confirming" - **blockchain_key** (string) - Optional - Filter by blockchain key - **rid** (string) - Optional - Filter by rid - **page** (integer) - Optional - Page number (default: 1) - **limit** (integer) - Optional - Number of results per page (default: 100) - **order_by** (string) - Optional - Field to order results by - **ordering** (string) - Optional - Sort order. Allowed values: "asc", "desc" - **time_from** (string) - Optional - Unix second timestamp for start time (e.g., 1691239429) - **time_to** (string) - Optional - Unix second timestamp for end time (e.g., 1691239429) ### Response #### Success Response (200) - **items** (array) - List of Withdraw objects - Each item represents a withdrawal record from account_entities.Withdraw #### Error Response (500) - **error** (object) - Internal Server Error details as per pkg.Error definition ### Request Example GET /trade/account/withdraws?status=success&page=1&limit=50&ordering=desc ### Response Example [ { "id": "withdraw_001", "status": "success", "blockchain_key": "btc_mainnet", "amount": 1.5, "created_at": 1691239429 } ] ``` -------------------------------- ### Websocket Endpoints Source: https://safetrade.com/api/v2/api Endpoints for establishing websocket connections for real-time data streams. ```APIDOC ## GET /websocket/private ### Description Establish a private websocket connection for authenticated users. ### Method GET ### Endpoint /websocket/private ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (101) - Switching Protocols - A websocket connection is established. #### Response Example (This is a websocket connection, not a standard HTTP response) ``` WebSocket connected. ``` ``` ```APIDOC ## GET /websocket/public ### Description Establish a public websocket connection for real-time market data. ### Method GET ### Endpoint /websocket/public ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (101) - Switching Protocols - A websocket connection is established. #### Response Example (This is a websocket connection, not a standard HTTP response) ``` WebSocket connected. ``` ``` -------------------------------- ### POST /trade/market/orders Source: https://safetrade.com/api/v2/trade/public/swagger Creates a new market order. Requires a request body specifying order parameters. ```APIDOC ## POST /trade/market/orders ### Description Creates a new market order. Requires a request body specifying order parameters. ### Method POST ### Endpoint /trade/market/orders ### Parameters #### Request Body - **params** (object) - Required - Order creation parameters. See `market.CreateOrderParams` definition. ### Request Example ```json { "params": { "market": "btcusdt", "side": "buy", "amount": "0.05", "price": "10500.00" } } ``` ### Response #### Success Response (201) - **order** (object) - The newly created order details. See `market_entities.Order` definition. #### Response Example ```json { "order": { "id": 124, "market": "btcusdt", "side": "buy", "price": "10500.00", "amount": "0.05", "status": "open" } } ``` #### Error Response (500) - **error** (object) - Contains error details. #### Error Response Example ```json { "error": { "code": 500, "message": "Internal Server Error" } } ``` ``` -------------------------------- ### Market Endpoints Source: https://safetrade.com/api/v2/api Endpoints for interacting with trading markets, including fetching orders and trades, and creating/canceling orders. ```APIDOC ## GET /trade/market/orders ### Description Get a list of orders. ### Method GET ### Endpoint /trade/market/orders ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **market_entities.Order** (array) - A list of order objects. #### Response Example ```json { "orders": [ { "id": "ord123", "market": "BTC/USD", "type": "limit", "side": "buy", "price": "10000.00", "amount": "0.1" } ] } ``` ``` ```APIDOC ## POST /trade/market/orders ### Description Create a new market order. ### Method POST ### Endpoint /trade/market/orders ### Parameters #### Query Parameters None #### Request Body - **market.CreateOrderParams** (object) - Required - Parameters for creating an order. - **market** (string) - Required - The trading pair (e.g., BTC/USD). - **type** (string) - Required - Order type (e.g., 'limit', 'market'). - **side** (string) - Required - Order side ('buy' or 'sell'). - **price** (string) - Required for limit orders - The price of the order. - **amount** (string) - Required - The amount of the asset to trade. ### Response #### Success Response (200) - **market_entities.Order** (object) - The details of the created order. #### Response Example ```json { "id": "ord456", "market": "BTC/USD", "type": "limit", "side": "buy", "price": "10000.00", "amount": "0.1", "status": "open" } ``` ``` ```APIDOC ## GET /trade/market/orders/{id} ### Description Get details of a specific order by its ID. ### Method GET ### Endpoint /trade/market/orders/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the order. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **market_entities.Order** (object) - The details of the order. #### Response Example ```json { "id": "ord123", "market": "BTC/USD", "type": "limit", "side": "buy", "price": "10000.00", "amount": "0.1", "status": "open" } ``` ``` ```APIDOC ## POST /trade/market/orders/{id}/cancel ### Description Cancel a specific order by its ID. ### Method POST ### Endpoint /trade/market/orders/{id}/cancel ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the order to cancel. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **pkg.StatusResponse** (object) - Confirmation of the cancellation. #### Response Example ```json { "success": true, "message": "Order cancelled successfully." } ``` ``` ```APIDOC ## GET /trade/market/trades ### Description Get a list of recent trades. ### Method GET ### Endpoint /trade/market/trades ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **market_entities.Trade** (array) - A list of trade objects. #### Response Example ```json { "trades": [ { "id": "trade123", "market": "BTC/USD", "price": "10050.00", "amount": "0.05", "side": "buy" } ] } ``` ``` ```APIDOC ## GET /trade/market/trades/{id} ### Description Get details of a specific trade by its ID. ### Method GET ### Endpoint /trade/market/trades/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the trade. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **market_entities.Trade** (object) - The details of the trade. #### Response Example ```json { "id": "trade123", "market": "BTC/USD", "price": "10050.00", "amount": "0.05", "side": "buy" } ``` ``` -------------------------------- ### GET /trade/account/withdraws Source: https://safetrade.com/api/v2/trade/public/swagger Retrieves a list of withdrawal transactions. Supports filtering by currency and status. ```APIDOC ## GET /trade/account/withdraws ### Description Retrieves a list of withdrawal transactions. This endpoint allows filtering by currency and withdrawal status. ### Method GET ### Endpoint /trade/account/withdraws ### Parameters #### Query Parameters - **currency** (string) - Optional - Filter withdrawals by currency type (e.g., 'usdt'). - **status** (string) - Optional - Filter withdrawals by their status. Possible values include: 'prepared', 'canceled', 'accepted', 'skipped', 'to_reject', 'rejected', 'processing', 'under_review', 'succeed'. ### Request Example ```json { "currency": "USDT", "status": "succeed" } ``` ### Response #### Success Response (200) - **withdrawals** (array) - An array of withdrawal objects. - Each withdrawal object contains details such as transaction ID, amount, currency, status, and timestamps. #### Response Example ```json { "withdrawals": [ { "txid": "wtx456def", "amount": "50.00000000", "currency": "USDT", "status": "succeed", "created_at": "2023-08-04T15:30:00Z", "updated_at": "2023-08-04T15:35:00Z" } ] } ``` #### Error Response (500) - **code** (integer) - Error code. - **message** (string) - Error message. ```