1.0.0 • Published 2 years ago

blockchain_com_exchange_rest_api v1.0.0

Weekly downloads
-
License
Unlicense
Repository
-
Last release
2 years ago

blockchain_com_exchange_rest_api

BlockchainComExchangeRestApi - JavaScript client for blockchain_com_exchange_rest_api

Introduction

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.

To Get Started

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

Installation

For Node.js

npm

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
Local development

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

git

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

For browser

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.

Webpack Configuration

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
      }
    }
  ]
}

Getting Started

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);

Documentation for API Endpoints

All URIs are relative to https://api.blockchain.com/v3/exchange

ClassMethodHTTP requestDescription
BlockchainComExchangeRestApi.PaymentsApicreateWithdrawalPOST /withdrawalsRequest a withdrawal
BlockchainComExchangeRestApi.PaymentsApigetAccountByTypeAndCurrencyGET /accounts/{account}/{currency}Receive current account balances
BlockchainComExchangeRestApi.PaymentsApigetAccountsGET /accountsReceive current account balances
BlockchainComExchangeRestApi.PaymentsApigetDepositAddressPOST /deposits/{currency}Get a deposit address. Currently only crypto currencies are supported
BlockchainComExchangeRestApi.PaymentsApigetDepositByIdGET /deposits/{depositId}Get status about a deposit
BlockchainComExchangeRestApi.PaymentsApigetDepositsGET /depositsGet a list of deposits
BlockchainComExchangeRestApi.PaymentsApigetWhitelistGET /whitelistGet a list of all whitelisted withdrawal accounts
BlockchainComExchangeRestApi.PaymentsApigetWhitelistByCurrencyGET /whitelist/{currency}Get a list of all whitelisted withdrawal accounts
BlockchainComExchangeRestApi.PaymentsApigetWithdrawalByIdGET /withdrawals/{withdrawalId}Get status about a withdrawal
BlockchainComExchangeRestApi.PaymentsApigetWithdrawalsGET /withdrawalsGet a list of withdrawals
BlockchainComExchangeRestApi.TradingApicreateOrderPOST /ordersAdd an order
BlockchainComExchangeRestApi.TradingApideleteAllOrdersDELETE /ordersDelete all open orders (of a symbol, if specified)
BlockchainComExchangeRestApi.TradingApideleteOrderDELETE /orders/{orderId}Cancel a trade
BlockchainComExchangeRestApi.TradingApigetFeesGET /feesGet current fee level
BlockchainComExchangeRestApi.TradingApigetFillsGET /tradesGet a list of filled orders
BlockchainComExchangeRestApi.TradingApigetOrderByIdGET /orders/{orderId}Get a specific order
BlockchainComExchangeRestApi.TradingApigetOrdersGET /ordersGet a list orders
BlockchainComExchangeRestApi.UnauthenticatedApigetL2OrderBookGET /l2/{symbol}L2 Order Book
BlockchainComExchangeRestApi.UnauthenticatedApigetL3OrderBookGET /l3/{symbol}L3 Order Book
BlockchainComExchangeRestApi.UnauthenticatedApigetSymbolByNameGET /symbols/{symbol}Symbols
BlockchainComExchangeRestApi.UnauthenticatedApigetSymbolsGET /symbolsSymbols
BlockchainComExchangeRestApi.UnauthenticatedApigetTickerBySymbolGET /tickers/{symbol}Price
BlockchainComExchangeRestApi.UnauthenticatedApigetTickersGET /tickersPrice

Documentation for Models

Documentation for Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-API-Token
  • Location: HTTP header
1.0.0

2 years ago

0.0.0

3 years ago

100.0.14

3 years ago