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
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' ;
Type aliases
AccountType
AccountType: "STANDARD" | "COMPATIBILITY" | "SEGWIT"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:20
CardStatus
CardStatus: "CREATED" | "ACTIVE" | "BLOCKED" | "SUSPENDED" | "FROZEN" | "EXPIRED" | "CANCELLED"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:24
CardType
CardType: "VIRTUAL" | "PHYSICAL"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:22
CurrencyCode
CurrencyCode: "ETH" | "BTC" | "BSV" | "USD" | "GBP" | "EUR"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:16
CurrencyType
CurrencyType: "CRYPTO" | "FIAT"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:12
CustodyOrderStatus
CustodyOrderStatus: "NEW" | "PENDING" | "CONFIRMED" | "FAILED"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:35
CustodyOrderType
CustodyOrderType: "DEPOSIT" | "WITHDRAW"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:33
CustodyType
CustodyType: "CUSTODY" | "NON-CUSTODY"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:14
Dictionary
Dictionary<K, T>: Partial < Record < K , T > >
Defined in node_modules/zumokit/src/interfaces/public/index.ts:10
Type parameters
ExchangeRates
Defined in node_modules/zumokit/src/models/ExchangeRates.ts:8
ExchangeSide
ExchangeSide: "BUY" | "SELL"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:60
ExchangeStatus
ExchangeStatus: "PENDING" | "WITHDRAWING" | "CONFIRMED" | "FAILED"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:62
HistoricalExchangeRates
Defined in node_modules/zumokit/src/models/HistoricalExchangeRates.ts:13
LogLevel
LogLevel: "trace" | "debug" | "info" | "warning" | "error" | "critical" | "off"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:1
Network
Network: "MAINNET" | "TESTNET" | "RINKEBY" | "ROPSTEN" | "GOERLI"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:18
TimeInterval
TimeInterval: "hour" | "day" | "week" | "month" | "quarter" | "year" | "max"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:64
TransactionDirection
TransactionDirection: "SENT" | "RECEIVED"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:46
TransactionFeeRates
Defined in node_modules/zumokit/src/models/TransactionFeeRates.ts:12
TransactionStatus
TransactionStatus: "PENDING" | "CONFIRMED" | "FAILED" | "RESUBMITTED" | "CANCELLED" | "PAUSED" | "REJECTED" | "AUTHORISED" | "REVERSED" | "REFUNDED"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:48
TransactionType
TransactionType: "CUSTODY" | "CUSTODY-DEPOSIT" | "CUSTODY-WITHDRAW" | "CRYPTO" | "FIAT" | "NOMINATED" | "CARD"
Defined in node_modules/zumokit/src/interfaces/public/index.ts:37
Exchange rates are contained in a mapping between from currency, to currency and exchange rates.