
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
react-native-mnemonic-key
Advanced tools
Native Android and iOS implementation of MnemonicKey for React Native
This library provides RNMnemonicKey
, a native Android and iOS implementation of Terra.js's MnemonicKey
, made available for React Native. This significantly improves performance and compatibility in mobile apps.
Install to your React Native app's package.json
:
$ yarn add react-native-mnemonic-key
You may need to set multiDexEnabled true
in your Android app's build.gradle
:
// android/app/build.gradle
android {
...
defaultConfig {
applicationId "com.example.reactnativemnemonickey"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true // ADD THIS LINE
}
}
You may need to modify your iOS app's Podfile
to enable Modular Headers for TrezorCrypto
.
# ios/Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'demo' do
use_unimodules!
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'TrezorCrypto', :modular_headers => true # ADD THIS LINE
end
Then run in your React Native iOS app's ios/
directory:
$ pod install
A full example demo app is available inside /example
.
The usage is nearly identical to Terra.js's MnemonicKey
, with the exception that RNMnemonicKey
cannot be instantiated with new
. You must use the static factory method RNMnemonicKey.create
, which returns a Promise<RNMnemonicKey>
.
// NOT ALLOWED!
// new RNMnemonicKey({ ...options })
// RIGHT WAY
RNMnemonicKey.create({ ...options }).then((rnmk) => terra.wallet(rnmk));
For your convenience, a full example demo app is provided as a reference inside /example
.
# Run iOS Demo
$ yarn example ios
# Run Android Demo
$ yarn example android
import * as React from 'react';
import { StyleSheet, View, Text } from 'react-native';
import { RNMnemonicKey } from 'react-native-mnemonic-key';
export default function App() {
const [result, setResult] = React.useState<RNMnemonicKey | undefined>();
React.useEffect(() => {
RNMnemonicKey.create({
mnemonic:
'satisfy adjust timber high purchase tuition stool faith fine install that you unaware feed domain license impose boss human eager hat rent enjoy dawn',
coinType: 118,
account: 5,
index: 32,
}).then(setResult);
}, []);
return (
<View style={styles.container}>
<Text>Address: {result?.accAddress}</Text>
<Text>ValAddress: {result?.valAddress}</Text>
<Text>Mnemonic: {result?.mnemonic}</Text>
<Text>PrivateKey: {result?.privateKey.toString('hex')}</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
});
This software is licensed under the MIT license. See LICENSE for full disclosure.
© 2021 Terraform Labs, PTE.
FAQs
Native Android and iOS implementation of MnemonicKey for React Native
The npm package react-native-mnemonic-key receives a total of 0 weekly downloads. As such, react-native-mnemonic-key popularity was classified as not popular.
We found that react-native-mnemonic-key demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.