1.0.4 • Published 6 years ago

react-native-brainblocks v1.0.4

Weekly downloads
22
License
-
Repository
github
Last release
6 years ago

react-native-brainblocks

Getting started

$ npm install react-native-brainblocks --save

Usage

import NanoPayment from 'react-native-brainblocks';

// Rai
<NanoPayment
  amount={1000}
  currency='rai'
  destination='xrb_36ooqx5oz3fppjijaabg1jxojn57cuacee31twsk5owewzqgp5bz7ck6rawn'
  onFailure={this._onFailure}
  onSuccess={this._onSuccess}
/>

// AUD
<NanoPayment
  amount={1.99}
  currency='aud'
  destination='xrb_36ooqx5oz3fppjijaabg1jxojn57cuacee31twsk5owewzqgp5bz7ck6rawn'
  onFailure={this._onFailure}
  onSuccess={this._onSuccess}
/>

// USD
<NanoPayment
  amount={1.99}
  currency='usd'
  destination='xrb_36ooqx5oz3fppjijaabg1jxojn57cuacee31twsk5owewzqgp5bz7ck6rawn'
  onFailure={this._onFailure}
  onSuccess={this._onSuccess}
/>

...

Note: 1 Rai = 0.000001 XRB

Sample

https://www.youtube.com/watch?v=Q3X7d6gAQzM

API

PropDescriptionTypeRequiredDefault
amountThe amount you would like to chargeNumberRequired
currencyThe currency that you would like to charge. This will be converted to XRB automatically based on current market rates.StringRequired
destinationThe destination RaiBlocks address. Note that brainblocks works through intermediate accounts so the address that shows up on screen is not the actual destination.StringRequired
onFailureCallback for if payment fails or times out within 120 seconds. Contains a string reason for the failureFunctionRequired
onSuccessCallback for when the payment succeeds. Contains an object with the token you should use to verify on the serverside.FunctionRequired
autoplayShould we automatically start a transaction or wait for user to tap firstboolOptionalfalse

Example

Example

Support 💙

React Native Lib Donation Address: xrb_36ooqx5oz3fppjijaabg1jxojn57cuacee31twsk5owewzqgp5bz7ck6rawn Brainblocks Donation Addresss: xrb_164xaa1ojy6qmq9e8t94mz8izr4mkf1sojb6xrmstru5jsif48g5kegcqg7y