Code Monkey home page Code Monkey logo

dex-api-python's People

Contributors

helldealer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dex-api-python's Issues

How to check order status?

import time
import dex_api_python
from dex_api_python.rest import ApiException
from dex_api_python.configuration import Configuration
from dex_api_python.api_client import ApiClient
from pprint import pprint

configuration = Configuration()
configuration.host = "https://dex-api.coinex.org"
client = ApiClient(configuration)

# create an instance of the API class
api_instance = dex_api_python.MarketApi(client)

try:
    api_response = api_instance.get_order('coinex15e7cud8d39qd368cx28w9vcm4s8nmy2s7xff7a-769')
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->get_order: %s\n" % e)

Return:

({'height': '7353734',
 'result': {'type': 'market/Order',
            'value': {'deal_money': None,
                      'deal_stock': None,
                      'freeze': '166004000',
                      'frozen_fee': None,
                      'height': '7348681',
                      'identify': 1,
                      'left_stock': '20000',
                      'order_type': 2,
                      'price': '8300.200000000000000000',
                      'price_precision': None,
                      'quantity': '20000',
                      'sender': 'coinex15e7cud8d39qd368cx28w9vcm4s8nmy2s7xff7a',
                      'sequence': '3',
                      'side': 1,
                      'time_in_force': '3',
                      'trading_pair': 'btc/usdt'}}},

How to determine the order status (Open/Closed/Canceled/Partial-closed/...)?

MarketApi.query_order 404 error

import time
import dex_api_python
from dex_api_python.rest import ApiException
from dex_api_python.configuration import Configuration
from dex_api_python.api_client import ApiClient
from pprint import pprint

configuration = Configuration()
configuration.host = "https://dex-api.coinex.org"
client = ApiClient(configuration)

# create an instance of the API class
api_instance = dex_api_python.MarketApi(client)
account = 'account_example' # str | Bech32 address
time = 789 # int | Unix timestamp
sid = 789 # int | Sequence id
count = 56 # int | Querier order count limited to 1024
token = 'token_example' # str | Symbol (optional)
tag = 'tag_example' # str | Filter responses type by tag string create/fill/cancel (optional)

try:
    # Query account's order
    api_response = api_instance.query_order(account, time, sid, count, token=token, tag=tag)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling MarketApi->query_order: %s\n" % e)

Return:

Exception when calling MarketApi->query_order: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Sat, 20 Jun 2020 13:13:07 GMT', 'Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '19', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=dea30579eec62b6f8e3f267164682f1a81592658787; expires=Mon, 20-Jul-20 13:13:07 GMT; path=/; domain=.coinex.org; HttpOnly; SameSite=Lax', 'X-Content-Type-Options': 'nosniff', 'X-Server-Time': '1592658787', 'CF-Cache-Status': 'DYNAMIC', 'cf-request-id': '03737595950000a3004eb76200000001', 'Expect-CT': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"', 'Server': 'cloudflare', 'CF-RAY': '5a65becf5e94a300-HKG'})
HTTP response body: 404 page not found
curl -X GET "https://dex-api.coinex.org/market/user-orders" -H "accept: application/json"
404 page not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.