BlockchainComExchangeRestApi - JavaScript client for blockchain_com_exchange_rest_api
Welcome to Blockchain.com's Exchange API and developer documentation. \ These documents detail and give examples of various functionality offered by the API such as receiving real time market data, requesting balance information and performing trades.
Create or log into your existing Blockchain.com Exchange account \ Select API from the drop down menu \ Fill out form and click “Create New API Key Now” \ Once generated you can view your keys under API Settings. \ Please be aware that the API key can only be used once it was verified via email.
The API key must be set via the \
X-API-Token
\
header.
The base URL to be used for all calls is \
https://api.blockchain.com/v3/exchange
Autogenerated clients for this API can be found here.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install blockchain_com_exchange_rest_api --save
Finally, you need to build the module:
npm run build
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
To use the link you just defined in your project, switch to the directory you want to use your blockchain_com_exchange_rest_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
Finally, you need to build the module:
npm run build
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var BlockchainComExchangeRestApi = require('blockchain_com_exchange_rest_api');
var defaultClient = BlockchainComExchangeRestApi.ApiClient.instance;
// Configure API key authorization: ApiKeyAuth
var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
ApiKeyAuth.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyAuth.apiKeyPrefix['X-API-Token'] = "Token"
var api = new BlockchainComExchangeRestApi.PaymentsApi()
var createWithdrawalRequest = new BlockchainComExchangeRestApi.CreateWithdrawalRequest(); // {CreateWithdrawalRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createWithdrawal(createWithdrawalRequest, callback);
All URIs are relative to https://api.blockchain.com/v3/exchange
Class | Method | HTTP request | Description |
---|---|---|---|
BlockchainComExchangeRestApi.PaymentsApi | createWithdrawal | POST /withdrawals | Request a withdrawal |
BlockchainComExchangeRestApi.PaymentsApi | getAccountByTypeAndCurrency | GET /accounts/{account}/{currency} | Receive current account balances |
BlockchainComExchangeRestApi.PaymentsApi | getAccounts | GET /accounts | Receive current account balances |
BlockchainComExchangeRestApi.PaymentsApi | getDepositAddress | POST /deposits/{currency} | Get a deposit address. Currently only crypto currencies are supported |
BlockchainComExchangeRestApi.PaymentsApi | getDepositById | GET /deposits/{depositId} | Get status about a deposit |
BlockchainComExchangeRestApi.PaymentsApi | getDeposits | GET /deposits | Get a list of deposits |
BlockchainComExchangeRestApi.PaymentsApi | getWhitelist | GET /whitelist | Get a list of all whitelisted withdrawal accounts |
BlockchainComExchangeRestApi.PaymentsApi | getWhitelistByCurrency | GET /whitelist/{currency} | Get a list of all whitelisted withdrawal accounts |
BlockchainComExchangeRestApi.PaymentsApi | getWithdrawalById | GET /withdrawals/{withdrawalId} | Get status about a withdrawal |
BlockchainComExchangeRestApi.PaymentsApi | getWithdrawals | GET /withdrawals | Get a list of withdrawals |
BlockchainComExchangeRestApi.TradingApi | createOrder | POST /orders | Add an order |
BlockchainComExchangeRestApi.TradingApi | deleteAllOrders | DELETE /orders | Delete all open orders (of a symbol, if specified) |
BlockchainComExchangeRestApi.TradingApi | deleteOrder | DELETE /orders/{orderId} | Cancel a trade |
BlockchainComExchangeRestApi.TradingApi | getFees | GET /fees | Get current fee level |
BlockchainComExchangeRestApi.TradingApi | getFills | GET /trades | Get a list of filled orders |
BlockchainComExchangeRestApi.TradingApi | getOrderById | GET /orders/{orderId} | Get a specific order |
BlockchainComExchangeRestApi.TradingApi | getOrders | GET /orders | Get a list orders |
BlockchainComExchangeRestApi.UnauthenticatedApi | getL2OrderBook | GET /l2/{symbol} | L2 Order Book |
BlockchainComExchangeRestApi.UnauthenticatedApi | getL3OrderBook | GET /l3/{symbol} | L3 Order Book |
BlockchainComExchangeRestApi.UnauthenticatedApi | getSymbolByName | GET /symbols/{symbol} | Symbols |
BlockchainComExchangeRestApi.UnauthenticatedApi | getSymbols | GET /symbols | Symbols |
BlockchainComExchangeRestApi.UnauthenticatedApi | getTickerBySymbol | GET /tickers/{symbol} | Price |
BlockchainComExchangeRestApi.UnauthenticatedApi | getTickers | GET /tickers | Price |
- BlockchainComExchangeRestApi.Balance
- BlockchainComExchangeRestApi.BalanceMap
- BlockchainComExchangeRestApi.BaseOrder
- BlockchainComExchangeRestApi.CancelOrderRequest
- BlockchainComExchangeRestApi.CreateWithdrawalRequest
- BlockchainComExchangeRestApi.DepositAddressCrypto
- BlockchainComExchangeRestApi.DepositInfo
- BlockchainComExchangeRestApi.Fees
- BlockchainComExchangeRestApi.OrdType
- BlockchainComExchangeRestApi.OrderBook
- BlockchainComExchangeRestApi.OrderBookEntry
- BlockchainComExchangeRestApi.OrderStatus
- BlockchainComExchangeRestApi.OrderSummary
- BlockchainComExchangeRestApi.PriceEvent
- BlockchainComExchangeRestApi.PriceEventList
- BlockchainComExchangeRestApi.Side
- BlockchainComExchangeRestApi.SymbolStatus
- BlockchainComExchangeRestApi.TimeInForce
- BlockchainComExchangeRestApi.TimeInForceStop
- BlockchainComExchangeRestApi.UnauthorizedError
- BlockchainComExchangeRestApi.WhitelistEntry
- BlockchainComExchangeRestApi.WithdrawalInfo
- BlockchainComExchangeRestApi.WithdrawalStatus
- Type: API key
- API key parameter name: X-API-Token
- Location: HTTP header