NAV Navbar
Zabo JS Client Zabo JS Server REST

Overview

Introduction

Welcome to the Zabo API! Zabo provides application developers a way to connect any cryptocurrency and any wallet to any application. Zabo is capable of operating in both centralized and decentralized environments. We also have an active sandbox connected to Bitcoin's testnet3 network, and Ethereum's Rinkeby network available to start your integration process. We provide programmatic access to various wallet providers and cryptocurrencies, along with the support and scope level of each. For instance, your application can read whether or not the send_crypto scope is available when a wallet connects. If you would like to manually review our list of supported wallets and currencies, you can review them at https://zabo.com/integrations. If you need us to add support, let us know by using the contact information below.

We’ve tried to make this documentation user-friendly and filled with examples, but if you have any questions, please reach out to us in Discord or via the contact form. Is registration required? No. You may use Zabo completely decentralized from start to finish. However, the fastest way to get your integration up and running is to use the quickstart guide in our dashboard, which walks through your entire Zabo integration step-by-step. You’ll integrate Zabo into your site or app and then use our client library or REST endpoints to retrieve the data you need from our API. You are welcome to register in our portal to try it out. Contact us and let us know how we can help!

Quickstart For Standard Setup in 3 steps

Zabo distributes its API through standard REST endpoints, plus a JavaScript SDK that can be used both in a client and server environment. Let's begin by looking at how we initialize a connnection.

Step 1 Import the Client SDK

There are several options to import the Client SDK. You can import using an html script tag

<!-- Using the latest version -->
<script src="https://cdn.zabo.com/latest/zabo.js"></script>

<!-- Using a specific version -->
<script src="https://cdn.zabo.com/0.6.0/zabo.js"></script>

or you can install it into a front-end framework, such as a Webpack or React project, via npm.

npm install --save zabo-sdk-js

then import it into your javascript file using require

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

or ES6 import format

import 'zabo-sdk-js'

// `Zabo` is now available

Step 2 Initialize Zabo

Zabo is initialized in the client with the following required information:

Zabo.init({
  clientId: 'YourAppKeyFromYourZaboDashboard',
  env: 'sandbox'
})

where clientId is found on the dashboard in your application menu.

Zabo dash1

Step3 Connect A User

You are ready to connect a user once Zabo has been initialized! To do this, provide a way to trigger the connect() function, such as a button, and give a callback function to the onConnection() handler.

// Here we add a listener to the first button in our html file
document.querySelector('button').addEventListener('click', () => {
  // We call the .connect() window when it is clicked, and provide a callback to `onConnection`
  Zabo.connect().onConnection((account) => {
    console.log(account)
  }).onError(error => {
    console.error('account connection error:', error)
  })
})

That's it! You now have an account object and the rest of the API at your fingertips. Keep reading to see how you can create multiple connections for one user

Multiple Wallets

To add multiple wallets to one user, we setup Zabo in your server. The SDK operates the same way on the server-side, but with different initialization credentials. You need to create an API key pair in the dashboard if you haven't done so already. To do this, click on your application on the dashboard, then select 'Keys' and 'Create New Key'.

Zabo dash2

Copy the public and private keys into a private file in your project. NOTE: The secret key will not be available after you leave this view. You will need to generate a new key pair if the secret key is lost.

Now you should load those keys into your server and initialize the SDK. NOTE: We do provide REST endpoints and the the server-side SDK is not required.

var zabo = require('zabo-sdk-js');

zabo.init({
  apiKey: process.env.PUBLIC_API_KEY,
  secretKey: process.env.SECRET_API_KEY,
  env: 'sandbox'
})

We return to the point we left in the previous section. After the user connects an account in the front-end of your application, we move the account to your server in the onConnection event.

document.querySelector('button').addEventListener('click', () => {
  Zabo.connect().onConnection((account) => {
    // Send the account object to your server
    PostDataToServer('/some-route', account)
  }).onError(error => {
    console.error('account connection error:', error)
  })
})

This must be done in the onConnection event. You will not be able to call accounts.get() later and use the object from that call to create a user.

You can use this account obect in your server to create a user.

let user = await zabo.users.create(account);

// Store this user in your database for retrieval later
StoreUser(user)

To add another account to this user, simply provide a way for the user to connect another wallet in the front-end

document.querySelector('#same-or-another-button').addEventListener('click', () => {
  Zabo.connect().onConnection((account) => {
    // Send the new account object to your server
    PostDataToServer('/some-route', account)
  }).onError(error => {
    console.error('account connection error:', error)
  })
})

Then you can add this account to the user you already created

let MyZaboUserObject = RetrieveUserFromDB()

let user = zabo.users.addAccount(MyZaboUserObject, account);

// Update this user in your database
UpdateUser(user)

That's it! Now you can retrieve information needed for your application.

NOTE: Two accounts cannot be connected in the front-end together. Only the latest connection will be directly active in the client. Requests for an account that is not actively connected in the frot-end, but is connected to a user, can be made through the server.

let MyZaboUserObject = RetrieveUserFromDB()

let balances = await zabo.users.getBalances({
    userId: MyZaboUserObject.id,
    accountId: MyZaboUserObject.account[0].id
  });

let otherBalances = await zabo.users.getBalances({
  userId: MyZaboUserObject.id,
  accountId: MyZaboUserObject.account[1].id
});

We're excited to see what you build with all of the cryptocurrency at your fingertips with the Zabo interface. If you are ready for more advanced cryptocurrency features, such as in decentralized mode, read on.

Decentralized Zabo

Zabo now supports decentralized operations for the Ethereum network. There is no registration nor server requirement to take advantage of Zabo's SDK and connect it to a node running on your system.

To do this, we start by initializing in decentralized mode.

Zabo.init({
  decentralized: true,
  useNode: 'http://localhost:8545'
})

Then we start an Ethereum node, such as geth

./geth --rinkeby --syncmode light --rpc --rpccorsdomain 'null' --rpcapi 'net,eth' --unlock '0xabcdef1...' --password '/path/to/a/password.txt'

There are a few things going on here, so let's talk about them.

We are starting the geth node on the rinkeby test network and utilizing the light syncmode. Other options include 'full' or 'fast', the default setting if starting Ethereum on Rinkeby from scratch. We are enabling the rpc api on the default port which makes our node available on http://localhost:8545.

Next, we set the cors setting so that our web browser will allow us to access the node. We set this to 'null' if we want to open our web page directly from our filesystem. Unlike before, we do not need to 'serve' our web page to work. If you do serve your webpage from a server, then set the rpc cors domain to the appropriate value, such as 'localhost:3000'. Next, we enable the two rpc services Zabo needs for operation: 'eth' and 'net'. If you do not intend on utilizing your node's wallet to send cryptocurrency, the last two options can be left off the command. If you do want to send cryptocurrency, then these last two options are required. You set the unlock flag with the account address for the account that will be sending cryptocurrency, and then provide a path to a text file which contains the password to unlock that account address. This password file should be one line that contains the appropriate password. Multiple unlocks are possible, but we will keep it simple for now.

Now you should have a node running and ready for connections. Let's go back to the front-end interface. If you decided to unlock an account in your node, you should also provide this account address to the Zabo init function

Zabo.init({
  decentralized: true,
  useNode: 'http://localhost:8545',
  useAddress: '0xabcdef1...'
})

We also offer the ability to create an 'address only' Zabo account if you are still running a server and would like access to public data. To do this, add the 'sendAppCryptoData' option to the 'init' call. This is disabled by default.

Zabo.init({
  decentralized: true,
  useNode: 'http://localhost:8545',
  useAddress: '0xabcdef1...',
  sendAppCryptoData: true
}).then((account) => { SendToYourServer(account) })

No call to connect() is necessary when operating in decentralized mode. You can simply make api calls after initializing Zabo. There are certain limitations noted in the documentation to the API functions when using a decentralized connection.

Decenralized Currency Info

One set of data you get when connected to Zabo's API servers is currency information. This information cannot be obtained from Zabo directly when decentralized. Therefore, we have provided token objects in the 'assets' folder of the zabo-sdk-js repository which you can import at your convenience. There are two files, zabo_erc20_tokens.js, which provides the top 20 tokens, and zabo_erc20_tokens_all.js which provides over 70 token objects.

NOTE: Zabo has not reached v1.0 and therefore defaults to the test networks. The addresses associated with these tokens represent them on the Rinkeby testnet.

A complete setup would look something like the following

<script src="zabo_erc20_tokens.js"></script>
<script src="zabo.js"></script>
<script>
  Zabo.init({
    decentralized: true,
    useNode: 'http://localhost:8545',
    useAddress: '0xabcdef1'
  }).then(async () => {
    let tx = await Zabo.transactions.send({
      currency: 'DAI',
      toAddress: '0x475dEd3e48d0182Fd684E3F78a1eE17659482C3B',
      amount: '50.003'
    })
    console.log(tx)
  })
</script>

Where zabo_erc20_tokens.js was obtained from the 'assets' folder in the zabo-sdk-js repository, and the zabo.js file was obtained from the 'dist' folder of the same repo.

Now you are decentralized!

NOTE: There is an unlimited amount of Zabo ERC20 tokens for you to use on the Rinkeby testnet, simply send them to an address you own.

Currency and Wallet Support

Zabo integrates a variety of wallets and currencies, each with their own set of capabilities and limitations. One of our primary goals for Zabo is to allow you to navigate these limitations programmatically, not manually. For instance, to send cryptocurrency from a wallet, the send_crypto scope will be present in the account object. If sending crypto is not possible for the connected wallet, your application will know this because of the missing scope and can adjust accordingly. We also provide standardized errors when an unsupported function is called.

There is also a list of currency and wallet support levels on our website at https://zabo.com/integrations. This listing can give you a high level overview of support for each of these components. If you notice anything that is not clear, please reach out to us and let us know.

Pagination

Most endpoints which return a list provide cursor-based pagination. Cursor information is found inside of the list_cursor object to facilitate subsequent requests. You can paginate through the results by using the id of the last resource in the list as a cursor parameter for the next call. The API provides a convenience value in list_cursor.next_uri which can be used to call for the next page of results. When has_more is false, you have reached the end of the list. The default limit is 25, but values up to 50 are permitted. We provide all lists in descending order only (newest item first).

Query Parameters

ParameterDefaultRequiredDescription
limit25OptionalCan be values 2-50
cursorFirst resource availableOptionalID of the resource to start from

This documentation explains Zabo integration in your application. We recognize that many decentralized applications do not run a server, so we do not require an application server to interact with Zabo. With that said, we do have the ability to work with your server authenticated users, which opens up two different ways you can connect with user wallets, depending on your application's setup. See Authentication for further information. You can view code examples in the dark area to the right as you read through the documentation.

Zabo API Intro

The Zabo API section defines the functions available for use in your application. These functions provide a way for your user to connect a wallet of their choice and provide the cryptocurrency data your application needs. After connecting, the client and server API functions can be accessed from your application's client or server, respectively. Each environment both shares similar functions, and has unique functions of their own. If you are only using the API from your application client, the account connection lives for as long as their session token remains unexpired in the client. After that, the user needs to connect their account again. If you are running a server which authenticates your users and would like a persistent connection, then you can use the server-side API to assign users with established accounts.

Security

Application developers should note that Zabo provides a simple interface with complex networking in our back-end to facilitate a better overall cryptocurrency developer and user experience. At no point do we obtain user wallet private keys or any sensitive data required to act upon cryptocurrency holdings independently. All authentication and approvals remain in the user's hands.

Zabo Faucets

Zabo provides cryptocurrency 'faucets' in the sandbox environment. Faucets are a way to obtain cryptocurrency on test networks in order to develop and test your application without risking loss of funds. Zabo has a limit to the amount of BTC, ETH, and HBARs you can obtain from Zabo internally. If you need to exceed these limits there are a few options:

  1. For Ethereum, visit https://faucet.rinkeby.io/ and send ETH to the address of your choice
  2. For Bitcoin, visit https://coinfaucet.eu/en/btc-testnet/ and send BTC to the address of your choice
  3. For HBAR or internal limit increases, contact us and let us know.

Internal ETH, BTC, and HBAR

Zabo allows you to obtain these currencies programmatically through custodial wallet connections. Each custodial wallet has a set amount of ETH, BTC, and HBAR (if supported) within the account. This means that you can send Ether, for instance, over the Rinkeby testnet to your MetaMask, or other wallet, by connecting a custodial account and sending Ether to the address through your application. The same can be done for BTC and HBAR.

Internal ERC20 tokens

Zabo has the ability to support all ERC20 tokens. For testing and development, we have created a select few ERC20 tokens on the Rinkeby testnet for you to use. These currencies are available on request at https://zabo.com/faucet. Token address information can be found at the bottom of this documentation here. NOTE: These tokens will only burn if tokens are sent back to the faucet address on Rinkeby. If you need to reduce an account's balance for an ERC20 token, then send the tokens to the following address in your application:

Zabo Rinkeby ERC20 burn address: 0xbb34af5777f285c42caD3f24f7ECb3d19dEa5C98

Base URL

Sandbox

https://api.zabo.com/sandbox-v0

Live

https://api.zabo.com/v0

Authentication

The Zabo API requires your users to authorize a connection to the wallet they choose. Before getting to this point, you must register yourself and your application with us, develop using our sandbox environment, then contact us to go live. Once the user has connected a wallet, your application can use the various Zabo functions to pull in data and provide it to your users. The user's approval happens when a user action triggers the connection widget. If your user does not have a wallet connected with Zabo, your application should provide a button or some interaction that triggers the Zabo.connect() function documented below. From there, Zabo takes the user through the process of selecting the wallet and currencies available. When the user returns from establishing a connection, the Zabo.onConnection() event provides the relevant wallet data. See the event documentation for further details.

Front-end only apps

If you're running a front-end only application, users receive a session token that initializes the Zabo SDK for JS in the client, and you do not need to take any further action for authentication. Session tokens do have a limited time-to-live depending on user activity and, once it expires, your user needs to connect again. If you are sending REST calls, you authenticate with a Bearer token and all calls must be made from https origins. The requests must have the following header:

The Zabo SDK for JS handles this authentication for you automatically.

App Server Authentication

Zabo uses API Key authentication for the Zabo Server API. This communication link provides programmatic access to administrative functions and provides a unified experience for your authenticated users and Zabo. You must establish API keys through your Zabo administrative dashboard after registering your application. You can create API Keys in the dashboard and use them to sign and send requests from your server. These requests must be signed and have the following headers:

The Zabo NPM package will do this under the hood for you once initialized. Once a user is established in the system, with an account linked, the application server can send future authenticated requests for data.

Signing Requests

If you are using the REST endpoints directly, the signature generated for the X-Zabo-Sig header is formed by using the paired secret key to create a SHA-256 HMAC on the following concatenated string:

Timestamp + Full Request URL + Request Body where:

Errors

Zabo.getAccount()
  .then(function (account) {
    /* See getAccount() section below */
  })
  .catch(function (error) {
    console.log(error)
    /* The error object below */
  })

error is the following JSON object:

{
  "error_type": 400,
  "message": "Connection closed by the user."
}

Or it could be:

{
  "error_type": 500,
  "message": "This is our error, please note the time and let us know you received this."
}

Zabo uses promises to return most responses. When implementing the catch function, the SDK provides an error object with the following error types:

Error TypeMeaning
400Bad Request -- Your request is invalid. Usually from a missing or incorrect parameter, or an unsupported function by the connected wallet provider*
401Unauthorized -- Proper credentials were not received.
402Request Failed -- A valid request was made but it failed.
403Forbidden -- You do not have access rights to the requested resource.
404Not Found -- The resource does not exist.
429Too Many Requests -- Too many calls happened in a short period of time.
500Internal Server Error -- This our error and you should note the time and let us know if you receive this.*

* A user-friendly message should be included with these errors.

Unsupported Functions

{
  "error_type": 400,
  "message": "Not supported for this wallet provider."
}

Due to limitations with certain wallet providers, some functions will not work if the user connected a wallet provider that does not support those functions. Your application should plan to handle these errors gracefully. Each function will list the currenct wallet provider support level. If a function is called, and the connected wallet provider does not support it, your application can expect to receive the error object to the right.

Connecting a user

Initialize the Zabo client SDK:

Zabo.init({
  clientId: 'YourAppKeyFromYourZaboDashboard',
  env: 'sandbox'
}).then(app => {
  console.log(app)
}).catch(err => {
  console.error(err)
})

Open connect widget in a new window:

Zabo.connect()
  .onConnection(function(account) {
    console.log(account)
    /* The account object outlined below */
  })
  .onError(function(error) {
    console.log(error)
    /* See errors section for more information */
  })
  .onDisconnect(function () {
    /* Provide connect button again after disconnect */
  })

Open widget in an iframe instead:

Zabo.connect({
  interfaceType: 'iframe',
  attachTo: 'body'
})
.onConnection(function(account) {
  console.log(account)
  /* The account object outlined below */
})
.onError(function(error) {
  console.log(error)
  /* See errors section for more information */
})
.onDisconnect(function () {
  /* Provide connect button again after disconnect */
})

account is the following JSON object:

{
  "id": "663925bd-205d-479e-895f-27ec3891e8b3",
  "address": "b134235a-088a-489c-aa36-dc0841094db8",
  "token": "zabosession-abcdef1234567890",
  "exp_time": "Mon, 10 Jun 2019 02:45:50 UTC",
  "wallet_provider": {
    "name": "coinbase",
    "display_name": "Coinbase",
    "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/coinbase.png",
    "type": "oauth",
    "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
  },
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "type": "account",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "type": "UTXO",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This process should begin when the user indicates they would like to establish a new wallet connection, such as after pressing a button. Every application must utilize the connection process in their front-end to establish an initial account connection. If your application needs to extend beyond this available process, please contact us, and we can discuss how to handle your specific application's needs. Once you establish a connection, your application can continue to use the client SDK, or you can send this account object to your server and establish a server-side connection with Zabo if you are running an application server. This server process allows you to link the account to a user. See adding users for further information.

Connection Request

Zabo.connect()

The Zabo object becomes available to you after including the Zabo Client SDK in your project. Calling the connect function without any arguments starts the user connection process in its default state. A new browser window opens for the user to select which one of the wallet provider options they wish to connect with your application.

If the new browser window is not an ideal experience for the users of your app, you have the option to start the connect process within an iframe inside your app. To enable this functionality, please call the connect function with the interfaceType and attachTo parameters.

The attachTo option accepts any DOM selector supported by the document.querySelector() function.

The connect function does not return a promise; it uses events to provide a connection response. This function returns the Zabo object, which can be used to chain event callback functions as shown in the example to the right. The events that may be triggered are outlined below, and you should provide a callback function for each event. Applications running a server can use the onConnection event data to establish account authorization for the connected user.

Arguments

ParameterTypeRequiredDescription
interfaceTypestringOptionalwindow (default) or iframe
attachTostringOptionalHTML selector to attach the iframe
widthstringOptionalWidth in pixels of the iframe or window. Defaults to 540
heightstringOptionalHeight in pixels of the iframe or window. Defaults to 960

Zabo connect events

onConnection

Zabo.onConnection(function (account) {
  console.log(account)
})

If using Zabo Server API:

This event is called when the user has successfully authenticated and enabled their account for use by your application. The account object returned contains the same data available via getAccount() with the exception that it includes the token and exp_time fields. If you intend to use Zabo from your server, you should forward this object to your server and use it to create or update a user. This must be done in the onConnection event because the token will only be made available this one time in the onConnection event. If you are not using the Zabo API from your server, no further action is needed to continue using the Zabo Client SDK.

onError

Zabo.onError(function (error) {
  console.error(error)
})

This event is called when an error is triggered such as when the user does not provide access to their wallet for use by your application via Zabo. See the errors section for more information about the error object returned.

Zabo API

Zabo SDK for JS client script:

<script src="https://cdn.zabo.com/0.5.0/zabo.js"></script>
<script type="text/javascript">
  Zabo.init({
    clientId: "<Your App's Key>",
    env: "sandbox"
  }).then(app => {
    /* app is the application json object for the provided clientId */
    console.log(app)
  }).catch(err => {
    console.error(err)
  })
</script>

You can also use the 'latest' script:

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

This section documents the Zabo API for application developers. This API is available as standard REST endpoints, a script you can add directly into your html file, and as a package you can pull into your project.

Initializing the JS SDKs

// Or pull the `zabo-sdk-js` NPM package into your framework

// Initialize the Zabo client SDK for JS:
Zabo.init({
  clientId: 'YourAppKeyFromYourZaboDashboard',
  env: 'sandbox'
}).then(app => {
  console.log(app)
}).catch(err => {
  console.error(err)
})

// ES6 async/await
try {
  let app = await Zabo.init({
    clientId: 'YourAppKeyFromYourZaboDashboard',
    env: 'sandbox'
  })
  /* app is the application json object for the provided clientId */
} catch (error) {
  console.log(error)
  /* See errors section for more information */
}

When using one of the JS SDKs, they must be properly initialized using credentials you received when you registered in the Zabo dashboard. 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.

Initialization Arguments

ParameterDescriptionRequiredPlatform
clientIdApp Key acquired when registering a new application in Zabo Dashboard.RequiredBrowser
envZabo API environment the SDK is connecting with. Could be either sandbox or live. Only sandbox is available unless a live connection is approved.RequiredBoth
apiKeyAPI Key generated via the Application "Keys" tab at Zabo Dashboard.RequiredNode
secretKeySecret Key generated via the Application "Keys" tab at Zabo Dashboard.RequiredNode
autoConnectOptional boolean useful if you want the SDK to retrieve the application object from the Zabo API during zabo.init(). Defaults to true.OptionalBoth

Usage

All applications must use Zabo in their application client to initiate a wallet connection. To do this, add the script to the bottom of your <body> tag and before using any of the functions, or alternatively pull the zabo-sdk-js NPM package into your front-end framework. The first step is to call the connect function outlined above and establish a connection with the user's wallet. Your application can then continue to use the functions available here on the client side or, if running a server, use the server API for more functionality. Most functions in the client SDK for JS, except for the connect function, return promises which allow you to use async/await or chain then and catch blocks to obtain responses.

Developer Setup Note

If you are developing directly in an .html file, you still must serve this file from a localhost server due to origin requirements. For mac or Linux (with python installed) you can open the terminal, go into the file's directory, and run python -m SimpleHTTPServer 8000. This will serve the file at localhost:8000. For Windows, you can use an IDE extension such as Live Server for Visual Studio.

If you are using a front-end framework, such as Reactjs, these tools will provide a server for your development process.

Get an account

Get the current account information:

Zabo.accounts.getAccount()
  .then(function (account) {
    console.log(account)
    /* account is the json object outlined below */
  })
  .catch(function (error) {
    console.log(error)
    /* See errors section for more information */
  })

// ES6 async/await
try {
  let account = await Zabo.getAccount()
  /* account is the json object outlined below */
} catch (error) {
  console.log(error)
  /* See errors section for more information */
}

Returns the account JSON:

{
  "id": "663925bd-205d-479e-895f-27ec3891e8b3",
  "address": "b134235a-088a-489c-aa36-dc0841094db8",
  "wallet_provider": {
    "name": "coinbase",
    "display_name": "Coinbase",
    "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/coinbase.png",
    "type": "oauth",
    "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
  },
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "type": "account",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "type": "UTXO",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This function returns the current account connected. The account object contains information such as the wallet provider and wallet address used during connection with your app. This function should only be called from your application's client. To get account information from your application server, utilize getUser documented below for one of your users.

Client SDK for JS

Zabo.accounts.getAccount()

Server SDK for JS

Not available

HTTP Request

GET BASE_URL/accounts/:account_id
GET BASE_URL/sessions

Wallet Provider Support

All

Decentralized Support

Yes

Get a specific balance

Zabo.accounts.getBalances({currencies: ['ETH', 'BTC']})
  .then(function (balances) {
    console.log(balances)
    /* balances is the json object outlined below */
  })
  .catch(function (error) {
    console.log(error)
    /* User has not yet connected or doesn't have these currencies */
  })

// ES6 async/await
try {
  let balances = await Zabo.accounts.getBalances()
  // `balances` will be all available balances
  console.log(balances)
} catch (error) {
  console.log(error)
}

Returns the following JSON:

{
  "data": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "type": "account",
      "updated_at": 1560134750000
    },
    {
      "balance": "0.932",
      "currency": "BTC",
      "type": "UTXO",
      "updated_at": 1560134750000
    }
  ]
}

Returns the user balances for the requested currencies. When requesting balances from the client, the request should be made in the context of the connected account. When requesting from an application server, requests should be made in the context of a user. See documentation about users below. Cryptocurrencies available to your app can be queried using the currencies function documented below. If no currencies are specified, then all available currencies will be returned.

Client SDK for JS

Zabo.accounts.getBalances({ currencies })

Arguments

ParameterTypeRequiredDescription
currenciesarrayOptionalArray of 3-letter identifiers for each currency balance requested.

Server SDK for JS

zabo.users.getBalances({ userId, accountId, currencies })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currenciesarrayOptionalArray of 3-letter identifiers for each currency balance requested.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/balances

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/balances

Query Parameters

ParameterTypeRequiredDescription
currenciesstringOptionalComma separated list of 3-letter identifiers for each currency requested.

Wallet Provider Support

All

Decentralized Support

Yes. The currencies array may only contain one currency. This currency must either be 'ETH' or listed in one of the loaded token files.

Get transaction history

Get a list of blockchain transactions sent or received by this account address

Zabo.transactions.getList({
  currency: 'ETH',
  limit: 25
}).then(function(history) {
    console.log(history)
    /* history is the array outlined below */
  })
  .catch(function(error) {
    console.log(error)
    /* See errors section for more information */
  })

// ES6 async/await
try {
  let history = await Zabo.transactions.getList({
    limit: 25
  })
  // All transactions in the account will be returned if a currency parameter is not defined.
  console.log(history) 
} catch (error) {
  console.log(error)
}

Returns the following array of JSON objects:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/accounts/8b0a037f-67cb-44b7-ac2a-18e7a54561a8/transactions?limit=25&currency=eth",
    "next_uri": ""
  },
  "data": [
    {
      "id": "0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a",
      "type": "send",
      "currency": "ETH",
      "amount": "0.1",
      "status": "completed",
      "other_parties": ["0x839395e20bbb182fa440d08f850e6c7a8f6f0780"],
      "initiated_at": 123456789000,
      "confirmed_at": 123456789000
    },
    {
      "id": "0x..."
    }
  ]
}

This function returns a transaction history list for the current account and given currency. This list is currently only provided in descending order. All transactions that have sent or received value will be included if no currency is specified.

NOTE: If using the sandbox, a list of several mock transactions will be returned to aide in development.

Client SDK for JS

Zabo.transactions.getList({ currency, limit, cursor })

Arguments

ParameterTypeRequiredDescription
currencystringOptional3-letter identifier for the currency requested.

Server SDK for JS

zabo.transactions.getList({ userId, accountId, currency, limit, cursor })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currencystringOptional3-letter identifier for the currency requested.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/transactions

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/transactions

Query Parameters

ParameterTypeRequiredDescription
currencystringOptional3-letter identifier for the currency requested.

Wallet Provider Support

All except Hedera.

Decentralized Support

No

Get a specific transaction

Zabo.transactions.getOne({
  txId: '0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a',
  currency: 'ETH'
}).then(function(tx) {
  console.log(tx)
  /* tx is the transaction object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let tx = await Zabo.transactions.getOne({
    txId: '0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a',
    currency: 'ETH'
  })
} catch (error) {
  console.log(error)
}

Returns a single transaction JSON object:

{
  "id": "0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a",
  "type": "send",
  "amount": "0.1",
  "currency": "ETH",
  "status": "completed",
  "other_parties": ["0x839395e20bbb182fa440d08f850e6c7a8f6f0780"],
  "initiated_at": 123456789000,
  "confirmed_at": 123456789000
}

This function returns a specific transaction for the given account. If using the REST API or server SDK, and the transaction did not originate from the account, or if the account is not the recipient, an error will be returned. The client SDK handles this information for you.

Client SDK for JS

Zabo.transactions.getOne({ txId, currency })

Arguments

ParameterTypeRequiredDescription
txIdstringRequiredTransaction ID of the transaction being requested.
currencystringRequiredCurrency ticker of the transaction being requested, e.g. BTC for Bitcoin.

Server SDK for JS

zabo.transactions.getOne({ userId, accountId, txId, currency })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
txIdstringRequiredTransaction ID of the transaction being requested.
currencystringRequiredCurrency ticker of the transaction being requested, e.g. BTC for Bitcoin.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/transactions/:tx_id

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/transactions/:tx_id

Query Parameters

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the cryptocurrency involved in this transaction.

Wallet Provider Support

All except Hedera.

Decentralized Support

Yes

Send a transaction

Zabo.transactions.send({
  currency: 'ETH',
  toAddress: '0x839395e20bbb182fa440d08f850e6c7a8f6f0780',
  amount: 0.59
}).then(function(tx) {
  console.log(tx)
  /* tx is the transaction object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let tx = await Zabo.transactions.send({
    currency: 'ETH',
    toAddress: '0x839395e20bbb182fa440d08f850e6c7a8f6f0780',
    amount: 0.59
  })
  if (tx.request_link) {
    let qrCode = Zabo.utils.getQRCode(tx.request_link)
    document.getElementById('placeHolder').innerHTML = qrCode
  } else {
    console.log(tx)
  }
} catch (error) {
  console.log(error)
}

// For MetaMask connections
Zabo.transactions.send({
  currency: 'ETH',
  toAddress: '0x839395e20bbb182fa440d08f850e6c7a8f6f0780',
  amount: 0.59
})
.then(function(tx) {
  Zabo.transactions.onConfirmation(tx.id, (transaction) => {
    console.log(transaction)
  })
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

Returns a single transaction JSON object:

{
  "id": "0x158be2ad4ba161c1a67e9b5646d2ed35bd4940b708103635dfd84f5ef252c18a",
  "type": "send",
  "amount": "0.59",
  "currency": "ETH",
  "status": "pending",
  "other_parties": ["0x839395e20bbb182fa440d08f850e6c7a8f6f0780"],
  "initiated_at": 123456789000,
  "confirmed_at": 123456789000
}

// Or if the user has a mobile wallet that uses deeplinks, such as Hedera

{
  "request_link": "https://hedera.app.link/5vuEEQhtLQ?acc=0.0.13365&action=payRequest&a=530000000&n=Thank+you+Zabo!"
}

This function will send cryptocurrency from the connected wallet. The application and wallet must have the send_crypto scope enabled. You may only transfer crypto out of a custodial wallet from the server, you cannot transfer from custodial wallets directly from a client. Note that you may send transfer requests from the client if a self-custody wallet is connected. The send_crypto scope will be present in the account object and, in this case, the sdk will form the transaction request for you.

We currently have a special case for MetaMask wallet connections. If sending a transaction from metamask, Zabo returns a skeleton transaction object which can be used to retrieve the full transaction after confirmation using Zabo.transactions.onConfirmation. Zabo waits approximately 7 blocks before providing a confirmed transaction on Ethereum. See the example in the Zabo JS Client section to the right.

The response will either be the resulting transaction object, or an object with the request_link key. If the connected wallet uses deeplinking to send a transaction directly from the wallet, the request_link key will be present with a uri. In this case you can use Zabo.utils.getQRCode(tx.request_link) to get a QR code and display it to the user.

If a send() call is attempted without the proper scope, an 'Unsupported Function' error will be returned.

Client SDK for JS

Zabo.transactions.send({ currency, toAddress, amount })

Arguments

ParameterTypeRequiredDescription
currencystringRequiredCurrency ticker of the currency being sent, e.g. BTC for Bitcoin.
toAddressstringRequiredAddress of the recipient
amountstringRequiredDecimal amount to be sent

Server SDK for JS

zabo.transactions.send({ userId, accountId, currency, toAddress, amount })

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredUser ID for the user sending the transaction
accountIdstringRequiredAccount ID of the wallet sending the transaction. Must belong to the user.
currencystringRequiredCurrency ticker of the currency being sent, e.g. BTC for Bitcoin.
toAddressstringRequiredAddress of the recipient
amountstringRequiredDecimal amount to be sent

HTTP Request

From Client: POST BASE_URL/accounts/:account_id/transactions

From Server: POST BASE_URL/users/:user_id/accounts/:account_id/transactions

Arguments

ParameterTypeRequiredDescription
currencystringRequiredCurrency ticker of the currency being sent, e.g. BTC for Bitcoin.
toAddressstringRequiredAddress of the recipient
amountstringRequiredDecimal amount to be sent

Wallet Provider Support

The account object will contain send_crypto in the scopes list if the connected wallet supports transfers. See 'Get An Account' for an example.

Decentralized Support

Yes. The currency being sent must be "ETH" or listed in a loaded token file.

Create a user

Create user:

Not available from application clients, only servers

Returns Response (201) and the following JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
      "wallet_provider": {
        "name": "metamask",
        "display_name": "MetaMask",
        "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
        "type": "private_key",
        "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
      }
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function creates a new user for your application. A user connects their cryptocurrency wallet via the Zabo Client API, and then you can create a user from your server. From there, your application server can have access this user's account data.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.create(account)

Arguments

ParameterTypeRequiredDescription
accountobjectRequiredThe account object received when the user connected. This object must contain a valid token.

HTTP Request

POST BASE_URL/users

Arguments

ParameterTypeRequiredDescription
accountobjectRequiredThe account object received from the Zabo Client after a user has connected an account, in the onConnection event. The token field must be present and associated with an active account.

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Get users

Get your users:

Not available from application clients, only servers

Returns the user JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/users?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
      "accounts": [
        {
          "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
          "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
          "wallet_provider": {
            "name": "metamask",
            "display_name": "MetaMask",
            "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
            "type": "private_key",
            "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
          }
        }
      ]
    }
  ]
}

This function returns all users registered with the application. You must have authorization to the users.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getList()

HTTP Request

GET BASE_URL/users

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Get a user

Get user information:

Not available from application clients, only servers

Returns the user JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
      "wallet_provider": {
        "name": "metamask",
        "display_name": "MetaMask",
        "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
        "type": "private_key",
        "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
      }
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function returns the user requested. The user object contains the user's unique id and accounts information, including the wallet provider and wallet address used during connection with your app.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getOne(userId)

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredThe user ID for the request.

HTTP Request

GET BASE_URL/users/:user_id

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Get a user account

Get user information:

Not available from application clients, only servers

Returns the user JSON:

{
  "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
  "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
  "wallet_provider": {
    "name": "metamask",
    "display_name": "MetaMask",
    "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
    "type": "private_key",
    "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
  },
  "currencies": [
    {
      "balance": "5.068",
      "currency": "ETH",
      "updated_at": 1560134750000
    }
  ],
  "created_at": 1560134750000,
  "updated_at": 1560134750000,
  "resource_type": "account"
}

This function returns the full account object for a particular user requested.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.getAccount({userId, accountId})

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredThe user ID for the request.
accountIdstringRequiredThe account ID for the request.

HTTP Request

GET BASE_URL/users/:user_id/accounts/:account_id

Wallet Provider Support

All

Decentralized Support

Not applicable

Add account to existing user

Add account to user:

Not available from application clients, only servers

Returns Response (201) and the following JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
      "wallet_provider": {
        "name": "metamask",
        "display_name": "MetaMask",
        "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
        "type": "private_key",
        "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
      }
    },
    {
      "id": "d838a489-7956-46e5-bb8a-a35ef757277a",
      "address": "b134235a-088a-489c-aa36-dc0841094db8",
      "wallet_provider": {
        "name": "coinbase",
        "display_name": "Coinbase",
        "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/coinbase.png",
        "type": "oauth",
        "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
      }
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function inserts an additional account into a given user object. Useful when your application makes it possible for the same user to connect with multiple wallet providers.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.addAccount(user, account)

Arguments

ParameterTypeRequiredDescription
userobjectRequiredThe user object received from zabo.users.create() response.
accountobjectRequiredThe account object received when the user connected. This object must contain a valid token.

HTTP Request

POST BASE_URL/users/:user_id/accounts

Arguments

ParameterTypeRequiredDescription
accountobjectRequiredThe account object received from the Zabo Client after a user has connected an account, in the onConnection event. The token field must be present and associated with an active account.

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Remove account from user

Remove account from user:

Not available from application clients, only servers

Returns Response (201) and the following JSON:

{
  "id": "17c0f27e-9916-4ace-b8ca-18d1be2cff43",
  "application": {
    "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
    "name": "Your App Name"
  },
  "accounts": [
    {
      "id": "8b0a037f-67cb-44b7-ac2a-18e7a54561a8",
      "address": "0x667dd163f1a0e6ef3e7bbe8e0676f62146d5662d",
      "wallet_provider": {
        "name": "metamask",
        "display_name": "MetaMask",
        "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
        "type": "private_key",
        "scopes": ["read_balances", "read_transactions", "send_crypto", "receive_crypto"]
      }
    }
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "user"
}

This function removes a defined account from a given user object. Use this function when a user doesn't want to have any specific wallet provider account linked to your application anymore.

Client SDK for JS

Not Available

Server SDK for JS

zabo.users.removeAccount({userId, accountId})

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredID of the user.
accountIdstringRequiredID of the account to remove.

HTTP Request

DELETE BASE_URL/users/:user_id/accounts/:account_id

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Get application

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "id": "b5cfb0d8-58de-4786-9545-3d38521d7d2b",
  "client_id": "aPublicKeyIdentifyingYourApp",
  "name": "Your App Name",
  "status": "Sandbox",
  "currencies": [
    { "type": "UTXO", "list": [ "BTC" ] },
    { "type": "account", "list": [ "ETH" ] }
  ],
  "wallet_providers": [
    {
      "name": "coinbase",
      "display_name": "Coinbase",
      "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/coinbase.png",
      "scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
        }
      ],
      "currencies": [
        { "type": "UTXO", "list": [ "BTC" ] },
        { "type": "account", "list": [ "ETH" ] }
      ]
    },
    {
      "name": "metamask",
      "display_name": "MetaMask",
      "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
      "scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
          "name": "read_transaction_history",
          "display_name": "Read Transaction History",
          "description": "Can read all past transactions."
        }
      ],
      "currencies": [
        { "type": "account", "list": [ "ETH" ] },
        { "type": "ERC20", "list": [ "all" ] }
      ]
    }
  ],
  "authorized_origins": [
    "zabo.com", "www.zabo.com"
  ],
  "created_at": 1420069800000,
  "updated_at": 1420069800000,
  "resource_type": "application"
}

This endpoint will return the specified application resource. You must have access rights to the application.

Client SDK for JS

Not Available

Server SDK for JS

zabo.applications.get()

HTTP Request

GET BASE_URL/applications/:application_id

Wallet Provider Support

Not applicable

Decentralized Support

Not applicable

Create a deposit address

Zabo.accounts.createDepositAddress('BTC').then(function(response) {
  console.log(response.address)
  /* address is the string outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let response = await Zabo.accounts.createDepositAddress('BTC')
} catch (error) {
  console.log(error)
}

Returns Response (200) and the following JSON:

{
  "currency": "BTC",
  "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
}

This endpoint will create and return a deposit address for the specified account. This address can also be displayed via QR code using the provided Zabo utility: let qrCode = Zabo.utils.getQRCode(response.address). If the currency is not supported by the connected wallet provider, you will receive an 'unsupported' error. See Unsupported Functions for more information.

Client SDK for JS

Zabo.accounts.createDepositAddress(currency)

Arguments

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the currency this deposit address should be used for.

Server SDK for JS

zabo.users.createDepositAddress({userId, accountId, currency})

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currencystringRequired3-letter identifier for the currency to be deposited.

HTTP Request

From Client: POST BASE_URL/accounts/:account_id/deposit-adresses

From Server: POST BASE_URL/users/:user_id/accounts/:account_id/deposit-adresses

Query Parameters

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the currency this deposit address should be used for.

Wallet Provider Support

Binance does not support creating new deposit addresses. It provides one static address per account and this address will be returned when createDepositAddress is used. To retrieve this address using the REST API, use the GET /accounts/:account_id/deposit-addresses endpoint documented below.

Decentralized Support

Yes

Get deposit addresses

Zabo.accounts.getDepositAddresses('BTC').then(function(addresses) {
  console.log(addresses)
  /* addresses is the object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let addresses = await Zabo.accounts.getDepositAddresses('BTC')
} catch (error) {
  console.log(error)
}

Returns Response (200) and the following JSON:

{
  "data": [
    {
      "currency": "BTC",
      "address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"
    }
  ]
}

This endpoint will retrieve all deposit addresses for the specified account. If the currency is not supported by the connected wallet provider, you will receive an 'unsupported' error. See Unsupported Functions for more information.

Client SDK for JS

Zabo.accounts.getDepositAddresses(currency)

Arguments

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the currency this deposit address should be used for.

Server SDK for JS

zabo.users.getDepositAddresses({userId, accountId, currency})

Arguments

ParameterTypeRequiredDescription
userIdstringRequiredString UUID of the user established with Zabo.
accountIdstringRequiredString UUID of an account that belongs to the user.
currencystringRequired3-letter identifier for the currency to be deposited.

HTTP Request

From Client: GET BASE_URL/accounts/:account_id/deposit-adresses

From Server: GET BASE_URL/users/:user_id/accounts/:account_id/deposit-adresses

Query Parameters

ParameterTypeRequiredDescription
currencystringRequiredThree-letter identifier for the currency this deposit address should be used for.

Wallet Provider Support

All

Decentralized Support

Yes

Utility Functions

The following utility functions are available using Zabo.

Get QR Code

Get a QR Code capable of being displayed betwen HTML img tags

let qrCode = Zabo.utils.getQRCode(data)

This function will provide a QR Code for the given data.

Data Endpoints

The following endpoints will provide general crypto information. These are not available for decentralized connections.

Get exchange rates

Get a list of current market exchange rates for all supported cryptocurrencies

Zabo.currencies.getExchangeRates().then(function(exchangeRates) {
  console.log(exchangeRates)
  /* exchangeRates is the array outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let exchangeRates = await Zabo.currencies.getExchangeRates()
} catch (error) {
  console.log(error)
}

Returns the following array of JSON objects:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/exchange-rates?limit=25&fiat_currency=USD",
    "next_uri": ""
  },
  "data": [
    {
      "from": "BTC",
      "to": "USD",
      "rate": "8000.00",
      "timestamp": 145824503000
    },
    {
      "from": "ETH",
      "to": "USD",
      "rate": "300.00",
      "timestamp": 145824503000
    }
  ]
}

Or the following JSON object if a crypto_currency paramter is provided:

{
  "from": "BTC",
  "to": "USD",
  "rate": "8000.00",
  "timestamp": 145824503000
}

This function returns a list of exchange rates for the available cryptocurrencies for the given fiat currency. Currently, only USD is the fiat currency available. Any supported currency can be used for the cryptoCurrency parameter. This parameter is optional and, if left out, all supported cryptocurrencies will be returned.

Wallet Provider Support

Not Applicable

Client SDK for JS

Zabo.currencies.getExchangeRates({ fiatCurrency, cryptoCurrency, toCrypto })

Arguments

ParameterTypeRequiredDescription
fiatCurrencystringOptionalUSD (default) is currently the only option.
cryptoCurrencystringOptionalIf left out, all supported cryptocurrencies are returned.
toCryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

Server SDK for JS

zabo.currencies.getExchangeRates({ fiatCurrency, cryptoCurrency, toCrypto })

Arguments

ParameterTypeRequiredDescription
fiatCurrencystringOptionalUSD (default) is currently the only option.
cryptoCurrencystringOptionalIf left out, all supported cryptocurrencies are returned.
toCryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

HTTP Request

GET BASE_URL/exchange-rates

Query Parameters

ParameterTypeRequiredDescription
fiat_currencystringOptionalUSD (default) is currently the only option.
crypto_currencystringOptionalIf left out, all supported cryptocurrencies are returned.
to_cryptoboolOptionalDefault is false and provides exchange rate to the fiatCurrency. If true, the rate will be cryptocurrency per unit of fiat.

Get all currencies

Zabo.currencies.getList().then(function(currencies) {
  console.log(currencies)
  /* currencies is the object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

// ES6 async/await
try {
  let currencies = await Zabo.currencies.getList()
} catch (error) {
  console.log(error)
}

Returns Response (200) and the following JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/currencies?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "ticker": "BTC",
      "name": "Bitcoin",
      "type": "UTXO",
      "logo": "https://zabo-static.s3.amazonaws.com/currencies/BTC.png",
      "priority": 1,
      "decimals": 9,
      "address": null,
      "resource_type": "currency"
    },
    {
      "ticker": "ETH",
      "name": "Ether",
      "type": "account",
      "logo": "https://zabo-static.s3.amazonaws.com/currencies/ETH.png",
      "priority": 2,
      "decimals": 18,
      "address": null,
      "resource_type": "currency"
    },
    {
      "ticker": "DAI",
      "name": "Dai",
      "type": "ERC20",
      "logo": "https://zabo-static.s3.amazonaws.com/currencies/DAI.png",
      "priority": 5,
      "decimals": 18,
      "address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
      "resource_type": "currency"
    }
  ]
}

This endpoint will return the full list of currencies available in the system. Use the /wallet-providers endpoint documented below to see the currencies supported by each wallet provider.

Wallet Provider Support

Not Applicable

Client SDK for JS

Zabo.currencies.getList()

Server SDK for JS

zabo.currencies.getList()

HTTP Request

GET BASE_URL/currencies

Get specific currency

Zabo.currencies.getOne('btc').then(function(currency) {
  console.log(currency)
  /* currency is the object outlined below */
})
.catch(function(error) {
  console.log(error)
  /* See errors section for more information */
})

Returns Response (200) and the following JSON:

{
  "ticker": "BTC",
  "name": "Bitcoin",
  "type": "UTXO",
  "logo": "https://zabo-static.s3.amazonaws.com/currencies/BTC.png",
  "priority": 1,
  "decimals": 9,
  "address": null,
  "resource_type": "currency"
}

This endpoint provides information about a specific currency.

Client SDK for JS

Zabo.currencies.getOne(currency)

Arguments

ParameterTypeRequiredDescription
currencystringRequired3-letter identifier for this currency

Server SDK for JS

zabo.currencies.getOne(currency)

Arguments

ParameterTypeRequiredDescription
currencystringRequired3-letter identifier for this currency

HTTP Request

GET BASE_URL/currencies/:currency

Get wallet providers

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "list_cursor": {
    "limit": 25,
    "has_more": false,
    "self_uri": "/wallet-providers?limit=25",
    "next_uri": ""
  },
  "data": [
    {
      "name": "coinbase",
      "display_name": "Coinbase",
      "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/coinbase.png",
      "auth_type": "oauth",
      "resource_type": "wallet_provider",
      "available_scopes": [
        {
          "name": "read_balances",
          "display_name": "Read Balances",
          "description": "Can read all balance information."
        },
        {
          "name": "read_transaction_history",
          "display_name": "Read Transaction History",
          "description": "Can read all past transactions.",
          "resource_type": "scope"
        }
      ],
      "available_currencies": [{ "type": "account", "list": [ "ETH" ] },{ "type": "UTXO", "list": [ "BTC" ] }],
      "resource_type": "wallet_provider"
    },
    {
      "name": "metamask",
      "display_name": "MetaMask",
      "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
      "auth_type": "private_key",
      "resource_type": "wallet_provider",
      "available_scopes": ["read_balances","read_transaction_history"],
      "available_currencies": [{ "type": "account", "list": [ "ETH" ] }, { "type": "ERC20", "list": [ "ALL" ] }],
      "resource_type": "wallet_provider"
    },
    {
      "name": "ledger",
      "display_name": "Ledger Hardware Wallet",
      "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/ledger.png",
      "auth_type": "private_key",
      "resource_type": "wallet_provider",
      "available_scopes": ["read_balances","read_transaction_history"],
      "available_currencies": [{ "type": "account", "list": [ "all" ] }, { "type": "ERC20", "list": [ "ALL" ] }],
      "resource_type": "wallet_provider"
    }
  ]
}

This endpoint will return the list of all wallet providers available for an application as well as the scopes and currencies available for that particular provider.

Wallet Provider Support

Not Applicable

Client SDK for JS

Not Available

Server SDK for JS

Zabo.walletProviders.getList()

HTTP Request

GET BASE_URL/wallet-providers

Get a wallet provider

Not available from application clients, only servers

Returns Response (200) and the following JSON:

{
  "name": "metamask",
  "display_name": "MetaMask",
  "logo": "https://zabo-static.s3.amazonaws.com/wallet-providers/metamask.png",
  "auth_type": "private_key",
  "resource_type": "wallet_provider",
  "available_scopes": [
    {
      "name": "read_balances",
      "display_name": "Read Balances",
      "description": "Can read all balance information."
    },
    {
      "name": "read_transaction_history",
      "display_name": "Read Transaction History",
      "description": "Can read all past transactions.",
      "resource_type": "scope"
    }
  ],
  "available_currencies": [{ "type": "account", "list": [ "ETH" ] }, { "type": "ERC20", "list": [ "all" ] }],
  "resource_type": "wallet_provider"
}

This endpoint will return the requested wallet provider resource. Note: The provider name is the all lowercase 'computer' name for the wallet provider, not the display name.

Client SDK for JS

Not Available

Server SDK for JS

zabo.walletproviders.getOne(name)

Arguments

ParameterTypeRequiredDescription
namestringRequiredName of the wallet provider

HTTP Request

GET BASE_URL/wallet-providers/:provider_name

ERC20 Rinkeby Addresses

The following is a list of ERC20 tokens and their addresses used by Zabo on the Rinkeby Network. To burn tokens out of an account's balance, send from the account to the Rinkeby faucet address:

**Zabo Rinkeby ERC20 burn address**: 0xbb34af5777f285c42caD3f24f7ECb3d19dEa5C98

CurrencyAddress
BAT0x180716c2a99429Bc4f19a10ea28693bA44a6B26f
DAI0x62a6ebC0ac598819CCad368788F6d2357FaE0d9e
LINK0x1dff79CfcE03751D254fd2322F52FEe0107bFC86
MKR0xA85f49574CDa7EC6D48c9b74f0D4A092eE453242
USDC0x7fAe10a97e6bE2cB84747D32dFe3444cbd799DbE
PAX0xD57a393AFd27Ea3AC3e2E54f6e29EA234e2664ed
TUSD0x8a5f7a5dC251baEC7F23810D5C79E200bb7192b7
ZRX0x00BEF1E237958621D07Ce5a7E1C01B0c9c172677
REP0x97e894aAE0551c53f83633606b9728050fc9e773
SNT0xe9bD0744a04DA0e44ddf6a13b2C41A3316E51eAA
REN0xb93962880ecD52536E487Df46165c77a0887Edbe
SNX0x924Ba5bfF703f20EA28EC31B5dDa82AaF4a9E020
NMR0x9A2D2A5D409d8E2F85F1151cD39DA8baABa1B276
NEXO0x122c1e3534C7E903cF8602A1F6141405c793D9ED
MANA0x181DB77f0DCcB0b92D1CF10c6BEF4abC2FA82ebf
DGD0xc6235714093975403B1926B42fd36544ce210B21
LRC0x561c5F978a5539E17654d12d0C5274cd252Cd537
KNC0x93d8A522c4e6792eEDD24FF02A83FE384abf4979
LOOM0xC71b57B695460e70aEfeb2f7a57A9012785E8974
MATIC0x5EEeE39b9a4351c7194f1287eF997eDFb1306F99
BNT0x64f11A49ecC07c3100EE77E2AE2db2140ea881a1
VERI0x449ddDEc6CAe80f46a69AB24cE5284E2B5da2CFC
STORJ0x557FaF7fA2573481777079DF3b637d246241f109
C200x75C648B425E800b49DFA8BcC2EeE555FA93b1Bcb
RHOC0xD065935AbA060246d00328682aFe80fEc5c961CA
ANT0x36b78f5b5Fe375f5455e50B9D777226a3cEb076b
FUN0xceB0E1822A412588Dfc905c7c8b9F7b9328e734a
RLC0xe19Ee2CFD89C6C2eBB5B42434e450F1B3Fa783FA
GNO0x3992F7EB69F1aE8843e45af8714B4C4D979632b3
CVC0x8b79FdA5e3A654AC61aED96Fedc7091D74cf15Be
TKN0xB3852c70FDCD2138642dA49bbC10D14371e30f4c
KIN0xB183E9eC9fcbd2Ba647BB6B56441b11e42F2e145
SALT0xF2D2B73d5bC9605B397D282eCC9FAA97798B5298
RDN0x5df5E7F94352f6796044ebf4C7D1975A68B67b32
DATA0xd54626081eBB4bEeF845b2019d7AE3975cCe3c0D
RCN0x7e1F743FFd53daF194Ced83004695b86F02419B5
FOAM0x1Fc4569BA6eEfB196b475da182E70a2D469bfF4b
WBTC0xF7D35FCC32435e4cEC958897B96Cc98860A051dd
DGX0x303a00b6D6f4CFeE4162ecC7700e11758Ee94911
HOT0x5ffB4bb6CaFa818C05dB8fA43df8B7945cF11575
MLN0x578180B15e528e816255cA79f1BB7Ce4BFb93413
AMPL0x021c724e5737f0B883C8898EceCF4DCE89E62a75
GRID0x4383E6B099cE5233a1CD50bb788D305815A1c8eF
SPANK0x68DECDA4E9Dbe23c7949B7cAd3aB709d8664118B
BLT0x79071729fdb8E10658744E0CC4058877c3a74b7e
GEN0xEC3D96EFcE090300d31A7726dB92520d56F4B052
PNK0x72c2731906a92D1CEf42445B6FFEbfde08d9772a
QCH0x549E07Be8a9E0E9e7D272af24476F814EC6c198a
LQD0xb77b87551b4561b7Fc4DE2cd260b2bfB6AA45184
DIP0x8C35428Cf159459095CF7398b743d4d231CED57B
LPT0x1a31d0E509e102a1Baba9D13e1012466DDd736AB
MGN0x1Cac8BeD3141B0da6B1c758A999eD9a01c8E2e55
MOD0xC4Ec9A8C17b659C11A8ACf92dBEE44D58dCB0aa7
PAN0xB2b4D8d51aff2D42BD9E30C3559d80087eA3f373
POA20xaEa795dDA836474Cc6BEdf4B1113331b9A5Dbe33
RPL0x77646F244f3Df5E008CcB57A5fc65f1f43210775
TAUD0x89897015422732619F63933CB897dCE1a8a1245b
TCAD0xe073690A77E2f843112359f9449Ad8760D7d351F
TGBP0xFc4Bd501F22cdFfa8F4dE728D881050729179Af0
THKD0xdBDA0611B39b1073d72FC7F401950F9e9Ef23665
UNI-V10x66850Fb0b635812A208C8686fb4852060EC34929
WCK0xd9C7980B8D7653E3B45f361DFb1eCe9c7a33ab69
WETH0x65d60584FcE83c8d52eD8f9AA08003C1F2A9ce3D
XCHF0xEd7B318DF45E1b919a9677B16d35C024b28A2fe1
cDAI0x7A978B38D5af06FF929CA06647E025b759479318
sETHnew0xBD3641796cb77589452049eea706D459D5084077
sETHold0x60f54521f06A6052E6d7ac77B595d3A86c015024
sUSD0xD53Eba376F638A57B297e7548022853f0F250338