Skip to content

alexmonkeype/react-native-trust-wallet-core

Repository files navigation

react-native-trust-wallet-core

React Native bridge for Trust Wallet Core.

Installation

npm install @alexmonkeype/react-native-trust-wallet-core

Android Setup: GitHub Packages Authentication

Trust Wallet Core for Android is hosted on GitHub Packages. You must configure authentication to download the dependencies.

Option 1: gradle.properties (Recommended for local dev)

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_TOKEN

Note: Generate a Personal Access Token (PAT) on GitHub with read:packages scope.

Option 2: Environment Variables (CI/CD)

Set the following environment variables:

  • GITHUB_ACTOR: Your GitHub username
  • GITHUB_TOKEN: Your Personal Access Token

Usage

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();

Architecture

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors