npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zabo-sdk-react-native

v1.0.0-beta.0

Published

Zabo SDK for React Native

Downloads

7

Readme

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 React Native SDK

The Zabo SDK for React Native provides convenient access to the Zabo API for mobile applications.

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.

Example

Documentation

See the Zabo API docs.

Requirements

  • React Native >= 0.62

Installation

npm install zabo-sdk-react-native --save

iOS Platform: Install pod

cd ios && pod install && cd ..

Android Platform: You are set!

Configuration

Zabo SDK React Native was inspired in the library React Native In App Browser.

It supports Chrome Custom Tabs for Android and SafariServices/AuthenticationServices for iOS.

Some extra configuration are necessary:

Configure Android Launch Mode

Configure Application launch mode as single task:

<application
  ...
  android:launchMode="singleTask">
  ...
</application>

Configure Deep Linking

zabo-sdk-react-native uses websocket to receive the connection success or connection error callbacks in the app. You can configure a custom link scheme to your app in order to have a better user experience.

1. Enable Deep Linking: Follow the instructions at React Native Linking documentation. You can create any scheme you desire. We are using zabo-appin our examples.

2. Configure Redirect URI: On login success, the Connect Widget will call back the redirect URI zabo-app://connected with the account data. In this case, you should configure this redirect URI in your account on Zabo console: Redirect URI

Usage

Zabo.init() parameters

| Param | Default | Description | Required | |------------|--------------------------|-----------------------------------------------------------------------------------------|----------| | clientId | | App Key acquired when registering a team in Zabo Dashboard. | Yes | | env | | sandbox or live | Yes | | apiVersion | v1 | v0 or v1 | No |

zabo.connect() parameters (Optional)

| Param | Default | Description | Required | |--------------|--------------------------|------------------------------------------|----------| | redirect_uri | | Url to be redirected after login success | No | | origin | zabo-sdk-react-native | Identification of connection origin | No |

Example

import React, { useEffect, useState } from 'react'
import { SafeAreaView, StyleSheet, ScrollView, View, Text, TouchableOpacity } from 'react-native'
import Zabo from 'zabo-sdk-react-native'

const App = () => {
  const [output, setOutput] = useState(null)

  useEffect(() => {
    setOutput('Loading SDk...')

    const init = async () => {
      try {
        await Zabo.init({
          clientId: 'YOUR_CLIENT_ID',
          baseUrl: 'https://api.zabo.com',
          connectUrl: 'https://connect.zabo.com',
          env: 'sandbox',
          apiVersion: 'v1'
        })

        setOutput('SDk is ready')
      } catch (err) {
        setOutput(`ERROR:\n${JSON.stringify(err)}`)
      }
    }

    init()
  }, [])

  const handleConnect = () => {
    const zabo = Zabo.instance
    const params = {
      redirect_uri: 'zabo-app://connected', // OPTIONAL
      origin: 'zabo-app'                    // OPTIONAL
    }
    zabo.connect({ params }).onConnection(account => {
      setOutput(`CONNECTED!\nACCOUNT:\n${JSON.stringify(account)}`)
    }).onError(err => {
      setOutput(`ERROR:\n${JSON.stringify(err)}`)
    })
  }

  return (
    <>
      <SafeAreaView>
        <ScrollView>
          <View style={styles.sectionContainer}>
            <TouchableOpacity onPress={handleConnect} style={styles.button}>
              <Text style={styles.buttonText}>CONNECT</Text>
            </TouchableOpacity>
          </View>
          {output &&
            <View style={styles.sectionContainer}>
              <Text>{output}</Text>
            </View>}
        </ScrollView>
      </SafeAreaView>
    </>
  )
}

const styles = StyleSheet.create({
  sectionContainer: { marginTop: 32, paddingHorizontal: 24 },
  button: { backgroundColor: '#3465E0', marginVertical: 16, padding: 16, alignItems: 'center' },
  buttonText: { fontSize: 16, fontWeight: '600', color: '#fff' }
})

export default App

After connecting

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

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!