All Projects → zabo-api → zabo-sdk-js

zabo-api / zabo-sdk-js

Licence: MIT License
Zabo is an API for connecting with cryptocurrency exchanges, wallets and protocols like Bitcoin.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to zabo-sdk-js

Crypto Signal
Github.com/CryptoSignal - #1 Quant Trading & Technical Analysis Bot - 3,100+ stars, 900+ forks
Stars: ✭ 3,690 (+21605.88%)
Mutual labels:  coinbase-api, binance-api
BitView
A crypto portfolio written in Flutter. It supports Binance, Bittrex, HitBTC, Coinbase, Coinbase Pro and Mercatox
Stars: ✭ 50 (+194.12%)
Mutual labels:  binance-api
binapi
Binance API C++ implementation
Stars: ✭ 129 (+658.82%)
Mutual labels:  binance-api
multi pairs martingle bot
A muti pairs martingle trading bot for Binance exchange.
Stars: ✭ 55 (+223.53%)
Mutual labels:  binance-api
CryptoCurrency.Net
CryptoCurrency.Net
Stars: ✭ 21 (+23.53%)
Mutual labels:  bitcoin-api
binance-connector-dotnet
Lightweight connector for integration with Binance API
Stars: ✭ 77 (+352.94%)
Mutual labels:  binance-api
profbit
Track your Coinbase profits!
Stars: ✭ 37 (+117.65%)
Mutual labels:  coinbase-api
coinbase-moneymoney
Fetches balances from Coinbase API and returns them as securities
Stars: ✭ 18 (+5.88%)
Mutual labels:  coinbase-api
binance-chain-kit-ios
Full Binance DEX iOS library (SDK), implemented on Swift.
Stars: ✭ 15 (-11.76%)
Mutual labels:  binance-api
howtrader
Howtrader is a crypto currency quant framework, you can easily develop, backtest and run your own strategy in real market. It also supports tradingview or other 3rd party signals, just simply send a post request and it will help trade automatically. Now it only support binance spot, futures and inverse futures exchange. It will support okex, ftx…
Stars: ✭ 294 (+1629.41%)
Mutual labels:  binance-api
binance-spot-order-notification-heoku
[binance order trade fill notification] Telegram Notification when Binance order created, cancelled or filled. Ready to Deploy on Heroku
Stars: ✭ 30 (+76.47%)
Mutual labels:  binance-api
spruned
A Bitcoin-without-Blockchain client w/ RPC that can fetch any block or transaction
Stars: ✭ 159 (+835.29%)
Mutual labels:  bitcoin-api
binance-to-google-sheets
Google Spreadsheets add-on to get data directly from Binance API without any intermediaries! 🚀
Stars: ✭ 367 (+2058.82%)
Mutual labels:  binance-api
TradeBot
Crypto trading bot using Binance API (Java)
Stars: ✭ 292 (+1617.65%)
Mutual labels:  binance-api
lara-block-io
A Laravel Package/Facade for the Block.io API
Stars: ✭ 22 (+29.41%)
Mutual labels:  bitcoin-api
candlestick retriever
Retrieve all historical candlestick data from crypto exchange Binance and upload it to Kaggle.
Stars: ✭ 122 (+617.65%)
Mutual labels:  binance-api
twitter-crypto-bot
This is a Twitter bot that tweets about cryptocurrencies prices every certain amount of minutes
Stars: ✭ 21 (+23.53%)
Mutual labels:  binance-api
binancer
An R client to the Public Rest API for Binance.
Stars: ✭ 51 (+200%)
Mutual labels:  binance-api
cryptodiversify
Automatically check your portfolio on the Binance exchange and advice you on rebalancing your portfolio into the top 20 cryptocurrencies by market capitalization
Stars: ✭ 43 (+152.94%)
Mutual labels:  binance-api
Crypto Coin Ticker
Bitcoin and Multi Crypto Coin Price Ticker with candlestick chart (Binance API Websocket) - SD-Config File Version
Stars: ✭ 37 (+117.65%)
Mutual labels:  binance-api

What is Zabo? A unified cryptocurrency API.

CircleCI Discord Discourse

Zabo is an API for connecting with cryptocurrency exchanges, wallets and protocols like Bitcoin. Instead of manually integrating with Coinbase API, Binance API, Bitcoin APIs or the hundreds of other cryptocurrency APIs - you can simply use Zabo for them all.

We believe teams and developers should focus on building great products, not worry about the fragmented landscape of exchange APIs and blockchain protocols.

For our updated list of integrations, check out our Zabo integrations.

Zabo API Javascript (JS) SDK

The Zabo SDK for JS provides convenient access to the Zabo API from applications written in browser and server-side JavaScript.

Please keep in mind that you must register and receive a team id to use in your client application, or if you are using the server side functions, generate an API keypair from your dashboard.

Documentation

See the Zabo API docs.

Installation

For a standard browser application, add the script tag to your html file:

<script src="https://cdn.zabo.com/develop/latest/zabo.js">

As a package:

npm install zabo-sdk-js --save

Usage

The first step is always to allow a user to connect from your front-end:

<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <meta charset="utf-8">
  <title>My Website</title>

  <link rel="stylesheet" href="example.css" type="text/css" />
</head>

<body>
  <section>
    <header>
      <h2>My Zabo Application</h2>
    </header>

    <button id="connect" type="button">Connect</button>

    <div>
      <h4>Other SDK methods</h4>
      <button id="getBalance" type="button">Crypto Balances</button>
      <button id="getHistory" type="button">Account History</button>
      <button id="getExchangeRates" type="button">Exchange Rates</button>
    </div>

  </section>

  <!--Add this script to your html file-->
  <script src="https://cdn.zabo.com/latest/zabo.js"></script>

  <script type="text/javascript">
    // Wait for document to fully load
    document.onreadystatechange = async () => {
      if (document.readyState !== 'complete') { return }

      const output = document.querySelector('#output')

      // Initiate Zabo SDK, replace the `clientId` field with your team client id.
      const zabo = await Zabo.init({
        clientId: 'YourClientIDFromTheZaboDotComDashboard',
        env: 'sandbox'
      })
      // Bind "connect" button
      document.querySelector('#connect').addEventListener('click', ev => {
        // Call connect when pressed and provide default .connect() window.
        zabo.connect().onConnection(account => {
          console.log('account connected:', account)
          bindOtherMethods()
        }).onError(error => {
          console.error('account connection error:', error.message)
        })
      })

      // Bind buttons for the other SDK example methods [Requires a successful zabo.connect() first]
      function bindOtherMethods () {
        document.querySelector('#getBalance').addEventListener('click', ev => {
          // Get ETH balance
          zabo.accounts.getBalances({ tickers: ["ETH"] }).then(balances => {
            console.log(balances)
          }).catch(error => {
            /* User has not yet connected or doesn't have an ether wallet */
            console.error(error)
          })
        })

        document.querySelector('#getHistory').addEventListener('click', ev => {
          // Get account transactions history
          zabo.transactions.getList({ ticker: 'ETH' }).then(history => {
            console.log(history)
          }).catch(error => {
            /* User has not yet connected */
            console.error(error)
          })
        })

        document.querySelector('#getExchangeRates').addEventListener('click', ev => {
          // Get crypto USD exchange rates
          zabo.currencies.getExchangeRates().then(rates => {
            console.log(rates)
          }).catch(error => {
            console.error(error)
          })
        })
      }
    }
  </script>
</body>

</html>

Or importing as a package:

const Zabo = require('zabo-sdk-js')

const zabo = await Zabo.init({
  clientId: 'YourClientIDFromTheZaboDotComDashboard',
  env: 'sandbox'
})

zabo.connect().onConnection(account => {
  console.log('account connected:', account)
}).onError(error => {
  console.error('account connection error:', error.message)
})

Or using ES6 modules:

import Zabo from 'zabo-sdk-js'

After connecting

After a user connects, the client SDK can continued to be used for the connected wallet:

zabo.transactions.getList({ ticker: 'ETH' }).then(history => {
  console.log(history)
}).catch(error => {
  /* User has not yet connected */
  console.error(error)
})

Or you can send the account to your server for the server-side SDK to create a unique user:

zabo.connect().onConnection(account => {
  sendToYourServer(account)
}).onError(error => {
  console.error('account connection error:', error.message)
})

// Then in your server
const Zabo = require('zabo-sdk-js')
let account = accountReceivedFromTheClient

Zabo.init({
  apiKey: 'YourPublicAPIKeyGeneratedInYourZaboDotComDashboard',
  secretKey: 'YourSecretAPIKey',
  env: 'sandbox'
}).then(zabo => {
  zabo.users.create(account)
}).catch(e => {
  console.log(e.message)
})

Zabo.init() Configuration

While instantiating your new Zabo SDK instance, you have a few configuration options that can be changed to best suit your needs. Please note that some options are available only when running the SDK from the browser while others are available when running the SDK on your node.js code.

Key Description Platform
clientId App Key acquired when registering a team in Zabo Dashboard. Browser
env Zabo API environment the SDK is connecting with. Could be either sandbox or live. Only sandbox is available unless a live connection is approved. Both
apiKey API Key generated via the Developer Settings section at Zabo Dashboard. Node
secretKey Secret Key generated via the Developer Settings section at Zabo Dashboard. Node
autoConnect Optional boolean useful if you wish to stop the SDK from fetching the team data during Zabo.init(). Defaults to true. Both
apiVersion Optional parameter to specify the Zabo API version. Could be either v0 or v1. Defaults to v1. Both

Server vs Client

The SDK can be used in either the client or server environment after a user connects their wallet, however, they have different functions available to them and utilize different authentication methods. See the Zabo API docs for more information.

Using Promises

Every method returns a chainable promise which can be used:

zabo.getTeam().then(a => {
  console.log(a)
}).catch(e => {
  console.log(e.message)
})

Or with async/await:

let exchangeRates = await zabo.currencies.exchangeRates()
console.log(exchangeRates)

Help and Further Information

Please read our docs and reach out to us in any or all of the following forums for questions:

Issues

If you notice any issues with our docs, this README, or the SDK, feel free to open an issue and/or a PR. We welcome community contributions!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].