React Native wrapper for the Samsung Blockchain Keystore SDK
$ npm install react-native-samsung-bks --save
$ react-native link react-native-samsung-bks
Add the following into the root project build.gradle
allprojects {
...
repositories {
...
flatDir {
dirs "$rootDir/aar"
}
}
}
Download the Samsung Blockchain Keystore SDK aar file and put it in android/aar
.
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNSamsungBKS;
to the imports at the top of the file - Add
new RNSamsungBKS()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-samsung-bks' project(':react-native-samsung-bks').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-react-native-sbksdk/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:implementation project(':react-native-samsung-bks')
- Add the following into the root project
build.gradle
allprojects {
...
repositories {
...
flatDir {
dirs "$rootDir/aar"
}
}
}
import RNSamsungBKS from 'react-native-samsung-bks';
The following methods of the SDK are available:
RNSamsungBKS.isSupported()
RNSamsungBKS.getDeepLinks()
RNSamsungBKS.getSeedHash()
RNSamsungBKS.checkForMandatoryAppUpdate()
RNSamsungBKS.getAddressList(hdPath)
RNSamsungBKS.signEthTransaction(hdPath, nonce, gasPrice, gasLimit, to, value, data)
RNSamsungBKS.signEthPersonalMessage(hdPath, b64MessageToSign)