Skip to content

NFC Tap protocol to support TAPSIGNER and SATCARD in javascript (react native)

License

Notifications You must be signed in to change notification settings

coinkite/cktap-protocol-react-native

 
 

Repository files navigation

React Native

Coinkite Tap Protocol library

A React Native JS library to enable easy communication with TAPSIGNER and SATSCARD.

-==[Request card development samples here]==-

Documentation Links

See the python library by Coinkite for protocol specifications.

Installation

yarn add coinkite-tap-protocol

Supporting node core modules

This library uses a few node core modules like secp256k1, buffer, crypto etc. which react native doesn't support because they probably use C++ code bundled with the Node JS binary, not Javascript.

We suggest using rn-nodify to enable using node core modules after yarn add coinkite-tap-protocol

Metro Plugin

rn-nodify needs stream-browserify for browser support.

metro.cofig.js

...
resolver: {
    extraNodeModules: {
      stream: require.resolve('stream-browserify'),
    },
  },
transformer: {
    ...
  },
...

Peer dependencies

react-native-nfc-manager is used for the NFC communications with the cards. Please refer to their docs for nfc integration.

~TDLR

  1. add the post install script in your package.json "postinstall": "rn-nodeify --install fs,dgram,process,path,console,crypto --hack"

  2. install the required modules yarn add coinkite-tap-protocol rn-nodify stream-browserify react-native-nfc-manager

  3. update metro config resolver

extraNodeModules: {
    stream: require.resolve('stream-browserify'),
}
  1. install respoective cocopod dependencies cd ios && pod install

About

NFC Tap protocol to support TAPSIGNER and SATCARD in javascript (react native)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%