React Native bridge for Trust Wallet Core.
npm install @alexmonkeype/react-native-trust-wallet-coreTrust Wallet Core for Android is hosted on GitHub Packages. You must configure authentication to download the dependencies.
Add your GitHub credentials to your global ~/.gradle/gradle.properties or your project's android/gradle.properties:
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_PERSONAL_ACCESS_TOKENNote: Generate a Personal Access Token (PAT) on GitHub with
read:packagesscope.
Set the following environment variables:
GITHUB_ACTOR: Your GitHub usernameGITHUB_TOKEN: Your Personal Access Token
import { Mnemonic, HDWallet, CoinType, AnySigner } from 'react-native-trust-wallet-core';
// 1. Create a Mnemonic
const mnemonic = await Mnemonic.create(128);
const isValid = await Mnemonic.isValid(mnemonic.id);
// 2. Create a Wallet
const wallet = await HDWallet.create(mnemonic, "");
// 3. Get Address
const address = await wallet.getAddressForCoin(CoinType.Ethereum);
console.log("Address:", address);
// 4. Sign Transaction (Example)
// const signed = await AnySigner.sign(inputBase64, CoinType.Ethereum);
// 5. Cleanup
// Native objects are stored in memory. Release them when done.
wallet.release();
mnemonic.release();This library uses the Classic React Native Bridge.
Native objects (like HDWallet or Mnemonic) are stored in a generic Object Store on the native side (Kotlin/Swift) and referenced by a UUID string in JavaScript.