Fork me on GitHub

Table of contents:

Institutional Partner Overview

Institutional Partner

Use case

The Institutional Partner API offers partners the ability to use Celsius features as a legal entity rather than as a user. This allows partners to reap the benefits and features of Celsius Network that to be accessed through the API rather than from a mobile app.

Features

Getting started

Please consult the Postman docs for the Institutional Partner API.

Security

  1. Each partner will receive a partner-token and the api-key from Celsius Network that will be used to authenticate that partner on Celsius API.
  2. Each request sent to the Celsius API is followed by the partner token and API key to successfully authenticate the partner.
  3. Responses sent back from the Celsius API will be signed using Celsius Network’s private key, and will automatically be verified on the SDK receiving end with the hardcoded public key.

Initializing the SDK

Initialize SDK in the following way:

const { Celsius, AUTH_METHODS, ENVIRONMENT } = require('celsius-sdk')
const partnerKey = process.env.PARTNER_TOKEN // Should be kept secret
const apiKey = process.env.API_KEY // Should be kept secret, can be regenerated

Celsius({
    authMethod: AUTH_METHODS.API_KEY, // We are telling the SDK that we are authenticating using a combination of an API key and a Partner token
    partnerKey: partnerKey,
    environment: ENVIRONMENT.staging // If not present, default is production.
}).then((celsius) => {
  // your code
})

Wallet actions

After initializing SDK, you can perform following actions:

Refresh currently supported currencies

celsius.getSupportedCurrencies().then((currencies) => {
  console.log(currencies) // or console.log(celsius.currencies)
}).catch((error) => {
  console.log(error)
})

Get balance for all currencies

celsius.getBalanceSummary(apiKey).then((balanceSummary) => {
    console.log(balanceSummary)
})
.catch((error) => {
    console.log(error)
})

Get balance for a single currency

const coin = 'BTC'

celsius.getCoinBalance(coin, apiKey).then((balanceSummary) => {
    console.log(balanceSummary)
})
.catch((error) => {
    console.log(error)
})

Get total interest earned

celsius.getInterestSummary(apiKey).then((interestSummary) => {
    console.log(interestSummary)
})
.catch((error) => {
    console.log(error)
})

Get paginated list of transactions for all currencies

const pagination = {
  page: 1,
  perPage: 20
}

celsius.getTransctionSummary(pagination, apiKey).then((transactions) => {
    console.log(transactions)
})
.catch((error) => {
    console.log(error)
})

Get paginated list of transactions for a single currency

const coin = 'BTC'
const pagination = {
  page: 1,
  perPage: 20
}

celsius.getCoinTransactions(coin, pagination, apiKey).then((transactions) => {
    console.log(transactions)
})
.catch((error) => {
    console.log(error)
})

Get address of a wallet for a specific currency

const coin = 'BTC'

celsius.getDeposit(coin, apiKey).then((address) => {
    console.log(address)
})
.catch((error) => {
    console.log(error)
})

Withdraw funds to an address

const coin = 'BTC'
const formFields = {
    address: DESTINATION_ADDRESS,
    amount: AMOUNT
}
const userSecret = USER_TOKEN

celsius.withdraw(coin, formFields, apiKey).then((transactionId) => {
    console.log(transactionId)
})
.catch((error) => {
    console.log(error)
})

Get status of a transaction

// transactionId is returned by the withdraw call

celsius.getTransactionStatus(transactionId, apiKey).then((status) => {
    console.log(status)
})
.catch((error) => {
    console.log(error)
})

Get interest rates for all supported coin

celsius.getInterestRates().then((interestRates) => {
   console.log(interestRates);
 }).catch((error) => {
   console.log(error);
 })

Obtaining coins for testing

Coin name Coin Type Faucet
Bitcoin TBTC https://bitcoinfaucet.uo1.net/
Bitcoin Cash TBCH https://developer.bitcoin.com/faucets/bch/
Bitcoin Gold TBTG https://test-faucet.bitcoingold.org/
Ethereum TETH https://faucet.kovan.network/
Litecoin TLTC http://testnet.litecointools.com/
Back to Home