All URIs are relative to https://www.bitmex.com/api/v1
Method | HTTP request | Description |
---|---|---|
userCancelWithdrawal | POST /user/cancelWithdrawal | Cancel a withdrawal. |
userCheckReferralCode | GET /user/checkReferralCode | Check if a referral code is valid. |
userCommunicationToken | POST /user/communicationToken | Register your communication token for mobile clients |
userConfirm | POST /user/confirmEmail | Confirm your email address with a token. |
userConfirmWithdrawal | POST /user/confirmWithdrawal | Confirm a withdrawal. |
userGet | GET /user | Get your user model. |
userGetAffiliateStatus | GET /user/affiliateStatus | Get your current affiliate/referral status. |
userGetCommission | GET /user/commission | Get your account's commission status. |
userGetDepositAddress | GET /user/depositAddress | Get a deposit address. |
userGetExecutionHistory | GET /user/executionHistory | Get the execution history by day. |
userGetMargin | GET /user/margin | Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies. |
userGetQuoteFillRatio | GET /user/quoteFillRatio | Get 7 days worth of Quote Fill Ratio statistics. |
userGetWallet | GET /user/wallet | Get your current wallet information. |
userGetWalletHistory | GET /user/walletHistory | Get a history of all of your wallet transactions (deposits, withdrawals, PNL). |
userGetWalletSummary | GET /user/walletSummary | Get a summary of all of your wallet transactions (deposits, withdrawals, PNL). |
userLogout | POST /user/logout | Log out of BitMEX. |
userMinWithdrawalFee | GET /user/minWithdrawalFee | Get the minimum withdrawal fee for a currency. |
userRequestWithdrawal | POST /user/requestWithdrawal | Request a withdrawal to an external wallet. |
userSavePreferences | POST /user/preferences | Save user preferences. |
Transaction userCancelWithdrawal(token)
Cancel a withdrawal.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var token = "token_example"; // String |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userCancelWithdrawal(token, callback);
Name | Type | Description | Notes |
---|---|---|---|
token | String |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
'Number' userCheckReferralCode(opts)
Check if a referral code is valid.
If the code is valid, responds with the referral code's discount (e.g. 0.1
for 10%). Otherwise, will return a 404 or 451 if invalid.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var opts = {
'referralCode': "referralCode_example" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userCheckReferralCode(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
referralCode | String | [optional] |
'Number'
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[CommunicationToken] userCommunicationToken(token, platformAgent)
Register your communication token for mobile clients
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var token = "token_example"; // String |
var platformAgent = "platformAgent_example"; // String |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userCommunicationToken(token, platformAgent, callback);
Name | Type | Description | Notes |
---|---|---|---|
token | String | ||
platformAgent | String |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
AccessToken userConfirm(token)
Confirm your email address with a token.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var token = "token_example"; // String |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userConfirm(token, callback);
Name | Type | Description | Notes |
---|---|---|---|
token | String |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Transaction userConfirmWithdrawal(token)
Confirm a withdrawal.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var token = "token_example"; // String |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userConfirmWithdrawal(token, callback);
Name | Type | Description | Notes |
---|---|---|---|
token | String |
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
User userGet()
Get your user model.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGet(callback);
This endpoint does not need any parameter.
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Affiliate userGetAffiliateStatus()
Get your current affiliate/referral status.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetAffiliateStatus(callback);
This endpoint does not need any parameter.
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
UserCommissionsBySymbol userGetCommission()
Get your account's commission status.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetCommission(callback);
This endpoint does not need any parameter.
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
'String' userGetDepositAddress(opts)
Get a deposit address.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetDepositAddress(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] |
'String'
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Object userGetExecutionHistory(symbol, timestamp)
Get the execution history by day.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var symbol = "XBTUSD"; // String |
var timestamp = new Date("2017-02-13T12:00:00.000Z"); // Date |
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetExecutionHistory(symbol, timestamp, callback);
Name | Type | Description | Notes |
---|---|---|---|
symbol | String | [default to XBTUSD] | |
timestamp | Date | [default to 2017-02-13T12:00:00.000Z] |
Object
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Margin userGetMargin(opts)
Get your account's margin status. Send a currency of "all" to receive an array of all supported currencies.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetMargin(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
QuoteFillRatio userGetQuoteFillRatio()
Get 7 days worth of Quote Fill Ratio statistics.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetQuoteFillRatio(callback);
This endpoint does not need any parameter.
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Wallet userGetWallet(opts)
Get your current wallet information.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetWallet(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Transaction] userGetWalletHistory(opts)
Get a history of all of your wallet transactions (deposits, withdrawals, PNL).
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt", // String |
'count': 100, // Number | Number of results to fetch.
'start': 0 // Number | Starting point for results.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetWalletHistory(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] | |
count | Number | Number of results to fetch. | [optional] [default to 100] |
start | Number | Starting point for results. | [optional] [default to 0] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
[Transaction] userGetWalletSummary(opts)
Get a summary of all of your wallet transactions (deposits, withdrawals, PNL).
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userGetWalletSummary(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
userLogout()
Log out of BitMEX.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.userLogout(callback);
This endpoint does not need any parameter.
null (empty response body)
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Object userMinWithdrawalFee(opts)
Get the minimum withdrawal fee for a currency.
This is changed based on network conditions to ensure timely withdrawals. During network congestion, this may be high. The fee is returned in the same currency.
var BitMexApi = require('bit_mex_api');
var apiInstance = new BitMexApi.UserApi();
var opts = {
'currency': "XBt" // String |
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userMinWithdrawalFee(opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | [optional] [default to XBt] |
Object
No authorization required
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
Transaction userRequestWithdrawal(currency, amount, address, opts)
Request a withdrawal to an external wallet.
This will send a confirmation email to the email address on record.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var currency = "XBt"; // String | Currency you're withdrawing. Options: `XBt`
var amount = 8.14; // Number | Amount of withdrawal currency.
var address = "address_example"; // String | Destination Address.
var opts = {
'otpToken': "otpToken_example", // String | 2FA token. Required if 2FA is enabled on your account.
'fee': 1.2, // Number | Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email.
'text': "text_example" // String | Optional annotation, e.g. 'Transfer to home wallet'.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userRequestWithdrawal(currency, amount, address, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
currency | String | Currency you're withdrawing. Options: XBt |
[default to XBt] |
amount | Number | Amount of withdrawal currency. | |
address | String | Destination Address. | |
otpToken | String | 2FA token. Required if 2FA is enabled on your account. | [optional] |
fee | Number | Network fee for Bitcoin withdrawals. If not specified, a default value will be calculated based on Bitcoin network conditions. You will have a chance to confirm this via email. | [optional] |
text | String | Optional annotation, e.g. 'Transfer to home wallet'. | [optional] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript
User userSavePreferences(prefs, opts)
Save user preferences.
var BitMexApi = require('bit_mex_api');
var defaultClient = BitMexApi.ApiClient.instance;
// Configure API key authorization: apiExpires
var apiExpires = defaultClient.authentications['apiExpires'];
apiExpires.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiExpires.apiKeyPrefix = 'Token';
// Configure API key authorization: apiKey
var apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';
// Configure API key authorization: apiSignature
var apiSignature = defaultClient.authentications['apiSignature'];
apiSignature.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiSignature.apiKeyPrefix = 'Token';
var apiInstance = new BitMexApi.UserApi();
var prefs = "prefs_example"; // String |
var opts = {
'overwrite': false // Boolean | If true, will overwrite all existing preferences.
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.userSavePreferences(prefs, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
prefs | String | ||
overwrite | Boolean | If true, will overwrite all existing preferences. | [optional] [default to false] |
apiExpires, apiKey, apiSignature
- Content-Type: application/json, application/x-www-form-urlencoded
- Accept: application/json, application/xml, text/xml, application/javascript, text/javascript