Skip to content

zumo/zumokit-react-native

Repository files navigation

ZumoKit React Native SDK

ZumoKit is a state of the art wallet architecture underpinning our flagship product Zumo that provides secure transfer and exchange of fiat and cryptocurrency funds.

Docs

Refer to ZumoKit SDK developer documentation and reference for usage details.

Installation

Install the package:

yarn add zumo/zumokit-react-native

Link the library (not required for React Native 0.60 and up):

react-native link react-native-zumo-kit

ZumoKit React Native SDK uses experimental TypeScript decorators, support for which has to be enabled:

yarn add @babel/plugin-proposal-decorators -D

Then, enable plugin @babel/plugin-proposal-decorators in babel.config.json:

plugins: [["@babel/plugin-proposal-decorators", { "legacy": true }]]

If your project uses typescript, modify compilerOptions in tsconfig.json:

"experimentalDecorators": true

Extra steps for iOS

ZumoKit CocoaPod relies on Git LFS to store native libraries, there you will need to install git-lfs client to be able to use it.

As ZumoKit is not yet distributed via CocoaPods Trunk, you'll need to include the ZumoKit Spec repo in your app's Podfile (usually located in the ios directory). You'll also need to ensure that the minimum iOS target is 10.0 or higher.

platform :ios, '11.0'

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/zumo/zumokit-specs.git'

target 'Demo' do
  # ...

  pod 'RNZumoKit', :path => '../node_modules/react-native-zumo-kit'

end

You will also need to execute pod install manually from the ios directory.

Extra step for Android

Set minSdkVersion to 21 in your android/build.gradle settings.

Usage

Entry point to ZumoKit SDK is loadZumoKit function. This function returns a Promise that resolves with a newly created ZumoKit object once ZumoKit SDK has loaded.

import zumokit from 'react-native-zumo-kit';

zumokit.init(
  API_KEY, 
  API_URL, 
  TRANSACTION_SERVICE_URL, 
  CARD_SERVICE_URL,
  NOTIFICATION_SERVICE_URL
);

Ask your account manager to provide you with necessary credentials.

ZumoKit module exports TypeScript declarations for ZumoKit types and interfaces via named exports. For example:

import { Account, Transaction, Exchange } from 'zumokit';