-
Notifications
You must be signed in to change notification settings - Fork 0
012security_authorization
- All requests based on the Http protocol .
- All input and output data are in JSON format.
- Visit Root URL: https://bcapi.movapi.com
- Install pybtm first, pip3 install pybtm
- Signature is required for trading API related interfaces. The signature data is placed in the body of the HTTP request. No signature is required for market API related interfaces.
- Rate limit: Now are no limited!
Sign in to [Bycoin] before invoking API and get Acquire Mnemonic Word in Account > API.
Then you use mov_sdk's get_guid_using_public_key function to get guid and secret_key! It will be very safe because secret_key only used by local lib(pybtm). Only use public key to get guid.
guid: the user's id
secret_key: the secret_key to sign the transcation.
Note: guid/secret_key is equivalent to your account/password. For your asset security, please keep it safe and change it regularly. Once lost, please create one new account!.
Request parameters should include guid and all parameters need to be signed.
E.g. Relevant parameters of a request are as follows:
POST:
Example1 send_order:
when you are creating one new order, you should send build information to server,
such as
{
'guid': '80f95d4c-65e0-4706-83d6-96e3184dddf7',
'price': '6100',
'amount': '0.01',
'side': 'buy',
'symbol': 'BTC/USDT'
}
When server gets it , then server will return some chain info to user, which includes "derivation_path" , "sign_data", "raw_transaction", "signing_instructions" These strings are used to sign the transcation.
The process is below:
raw_transaction = data["result"]["data"]["raw_transaction"]
signing_instructions = data["result"]["data"]["signing_instructions"]
arr = []
for signing in signing_instructions:
derivation_path = signing["derivation_path"]
sign_data = signing["sign_data"]
new_secret_key = key.get_child_xprv(self.secret_key, derivation_path)
sign_data = [key.xprv_sign(new_secret_key, s) for s in sign_data]
arr.append(sign_data)
params = {
"guid": self.guid,
"raw_transaction": raw_transaction,
"signatures": arr,
"client_id": "123"
}
Then we sent params to the submit address , to real send order.
Finally, we get the server response:
{
'code': 200,
'msg': '',
'result': {
'data': {
'transaction_hash': '665e657f91f2afe3c676bf94decb1f4062bd76030e2a9d2967193c3267582848',
'orders': [{
'order_id': 711076,
'client_id': '123'
}]
}
}
}
You can see that, your order is directly on the chain, the transcation has is 665e657f91f2afe3c676bf94decb1f4062bd76030e2a9d2967193c3267582848. The id of the order is 711076, the information which user give is "123"(client_id).
MOV Exchange has such features.
Common API
Flash API
Spot API
If any problems occur when using API, please contact us: support@8btc.com