react-native-fast-eth-wallet
v0.1.2
Published
A fast Ethereum wallet generator using native crypto for React Native apps
Downloads
22
Maintainers
Readme
react-native-fast-eth-wallet
A simple utility to generate Ethereum wallets from a mnemonic seed phrase using react-native-quick-crypto and ethers.
Features
- Generate Ethereum address and private key from a seed phrase (mnemonic).
- Supports multiple wallet derivation paths with an index.
- Uses PBKDF2 with SHA-512 as per BIP39.
- Works smoothly in React Native environments.
Installation
npm install react-native-quick-crypto ethers react-native-fast-eth-walletor with yarn
yarn add react-native-quick-crypto ethers react-native-fast-eth-walletUsage
import { createWallet } from 'react-native-fast-eth-wallet';
const seedPhrase = 'test test test test test test test test test test test junk';
const index = 0; // Optional: wallet index, default is 0
try {
const wallet = createWallet(seedPhrase, index);
console.log('Address:', wallet.address);
console.log('Private Key:', wallet.privateKey);
} catch (error) {
console.error(error.message);
}API
createWallet(seedPhrase: string, index?: number)
seedPhrase: Your mnemonic seed phrase (required).index: Optional derivation index for multiple wallets (default: 0).
Returns an object:
{
address: string, // Ethereum address
privateKey: string, // Private key
}Throws an error if seed phrase is missing or empty.
How it works
- Cleans the seed phrase.
- Creates a seed using PBKDF2 with salt
"mnemonic". - Derives wallet using path
m/44'/60'/0'/0/{index}. - Returns wallet address and private key.
Dependencies
react-native-quick-cryptoethers
License
MIT License
