Cede Logo

Cede SDK

Connect to multiple centralized exchanges with a single SDK

Cede SDK is a centralized exchange (CEX) connectivity solution that unifies access to multiple CEX APIs. At present, we support connections to over 10 CEXs using both API keys and OAuth. This SDK enables B2B stakeholders to effortlessly incorporate features like account balances, withdrawals, transaction histories, trades, and public data.

The solution can be implemented either on the client side or on the server side within the client's infrastructure.

npm install @cedelabs/sdk

Overview

import CedeSDK from "@cedelabs/sdk";
 
const cedeSDK = new CedeSDK("MOCK");
 
const exchangeInstanceId = cedeSDK.api.registerExchangeInstance({ exchangeId: "binance" });
 
cedeSDK.api.getBalances({ exchangeInstanceId }).then(console.log);

In this example, we create a new instance of the Cede SDK and get a list of supported exchanges. Then we get the first exchange from the list and get the balances for the exchange. The result will be an array of balances for all assets:

{
  "binance": {
    "expiry": "2021-03-21T18:00:00.000Z",
    "identifier": "portfolio-balances-1223-4562-5432-5345",
    "hydrate": true,
    "value": {
      "USDT": {
        "freeBalance": 5780,
        "refFreeBalance": 1200,
        "usedBalance": 0,
        "refUsedBalance": 0,
        "totalBalance": 5780,
        "refTotalBalance": 1200,
        "spot": {
          "freeBalance": 270,
          "refFreeBalance": 40,
          "usedBalance": 0,
          "refUsedBalance": 0,
          "totalBalance": 270,
          "refTotalBalance": 40,
          "originalWalletName": "spot"
        },
        "margin": {
          "freeBalance": 270,
          "refFreeBalance": 40,
          "usedBalance": 0,
          "refUsedBalance": 0,
          "totalBalance": 270,
          "refTotalBalance": 40,
          "originalWalletName": "margin"
        }
      }
    }
  }
}

Note, that we don't need to specify the API key or OAuth token, as the SDK was initialized with the MOCK mode. In this mode, the SDK will return mock data for all requests. If you want to use real data, you need to initialize the SDK with the "REAL" mode and provide the API key or OAuth token.

Features

Cede SDK supports all these features out-of-the-box:

  • Retrieve user balances for all assets and wallets: spot, margin, futures, etc.
  • Retrieve depositable tokens, networks and addresses
  • Retrieve withdrawable tokens, networks, minimum amounts and fees
  • Initialize withdrawals, track their status
  • Standardized networks and tokens with user-friendly names
  • Authentication with API keys and OAuth
  • Demo mode to test your integration without real API keys
  • Caching and request deduplication

...and a lot more.