npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@foxwallet/react-native-wallet-utils

v1.0.3

Published

The react native crypto library written in Rust/Go for FoxWallet

Downloads

6

Readme

@foxwallet/react-native-wallet-utils

This React Native library packages practical crypto functions written in Rust/Go for FoxWallet.

Getting started

yarn add @foxwallet/react-native-wallet-utils

# add to android/settings.gradle
include ':spacemesh-go'
project(':spacemesh-go').projectDir = new File(rootProject.projectDir, '../node_modules/@foxwallet/react-native-wallet-utils/spacemesh-go')

# add to ios/Podfile
pod 'react-native-wallet-utils', :path => "../node_modules/@foxwallet/react-native-wallet-utils", :configurations => ["Release", "Daily"]
pod 'react-native-wallet-utils-debug', :path => "../node_modules/@foxwallet/react-native-wallet-utils", :configurations => ["Debug"]

cd ios && pod install && cd ..

Usage

All the functions could be find in the index.d.ts file. They are wrapped with async behaviors, since we need access to Rust runtime, be sure to use await or then to access the result.

import WalletCore from "@foxwallet/react-native-wallet-utils";

async function getRandomPhrase() {
  const newRandomPhrase = WalletCore.randomPhrase(12);
}

Build and Develop

Requirements

  • node.js (>=10)
  • yarn (tested on 1.22.19)
  • rustup (tested on rustup 1.27.0)
  • rustc (tested on rustc 1.77.2)
  • cargo (tested on cargo 1.77.2)
  • android_ndk (tested on r23, can be downloaded here)
  • $NDK_HOME envarionment variable set to ndk home directory (eg. /usr/local/opt/android-ndk)
  • go

* It's recommended to install Android Studio and use that to install the necessary build tools and SDKs for the Android version you want to test on. It's also the best way to test in the emulator.

Setup

  • Use the following script to install the required rust toolchains.
./scripts/rust_init.sh

# rustup target add aarch64-apple-ios x86_64-apple-ios armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android

./scripts/go_init.sh

Develop

After update the Rust/Go code, you need to change the following files for updating the interface to native android and ios code.

  • ios/RustCore.h
  • ios/WalletCore.m
  • ios/WalletCore.swift
  • android/src/main/java/com/foxwalet/core/WalletCoreModule.java
  • index.js
  • index.d.ts

Test

  • To run the rust test
yarn test

Build

  • Use the following script to build the dynamic library for Android and static library for iOS.
./scripts/rust_build.sh
./scripts/go_build.sh