Getting Started

Register on Midas Protocol and Vinex Network

Firstly register an account with Midas Protocol.

Then login to Vinex Network by Midas Protocol account.

Generate an API Key

  1. Enable 2FA.
  2. Create an API Key.

General API Information

Base endpoint: https://api.vinex.network/

API Rate Limit

At the current time Vinex Network rate limits are:

  • 5 request per second
  • over 5 request will be block in 60s
  • and if over again will be block in block old time + 60s

API Signarure

Formula generate signature:

secret_key = 'your secret key'
list_params = ['param1', 'param2' 'param3']  # Sort params alphabetically
plain_text = 'param1_param2_param3'
signature = hmac256(secret_key, plain_text)

Example:

# Python: Create signature
import hashlib
import hmac

api_key = 'pspnd6nuf02rpws3upj8kr2ox52068r3'
api_secret = '07c6t3eu9uo0174rrkiqt3ih88o60vb0'

order = dict()
order['market'] = 'USDT_BTC'
order['amount'] = 10.0
order['price'] = 10000.0
order['type'] = 'BUY'
order['time_stamp'] = 1578992929
order['recv_window'] = 60

# 1. Create msg: <amount>_<market>_<price>_<recv_window>_<time_stamp>_<type>
msg = ''

for key in sorted(order.keys()):
    msg += '_' + str(order[key])

msg = msg[1:]
# Result: msg = '10.0_USDT_BTC_10000.0_60_1578992929_BUY'

# 2. Create signature from msg
msg_hmac = hmac.new(api_secret.encode(), msg.encode(), hashlib.sha256)
signature = msg_hmac.hexdigest()

# Result: signature = '03f9158997a9b43d1f84ea3dda9c7df729d20590e4a3d017d1b4bc55a0079b02'

List of constants

  1. Order status
    • FAILED = -1
    • FENDING = 10
    • FINISHED = 1
    • CANCELLED = 2
  2. Action types
    • SELL = 0
    • BUY = 1
  3. Order types
    • LIMIT = LIMIT
    • MARKET = MARKET
  4. Withdrawal status
    • WAIT APPROVE = 1;
    • PENDING = 2;
    • SUCCESS = 3;
    • PROCESSING = 7;
    • FAILED = 4;
    • REJECTED = 6