Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SignumJS Crypto Adapter for React Native EXPO

This is the React Native Expo implementation of the CryptoAdapter for @signumjs/crypto

Note: this adapter does only work with Expo - not for bare React Native!

For any Crypto operations, like signing transactions, en/decrypting P2P messages or even hash related operations you need to install this adapter.

Installation

  1. Install the package in your Expo Project (see Example)
npm install @signumjs/crypto @signumjs/react-native-expo-crypto-adapter
  1. Create or modify the Expo Apps metro.config.js to remove default crypto adapters from bundler
// metro.config.js
const { getDefaultConfig } = require('@expo/metro-config');

const defaultConfig = getDefaultConfig(__dirname);
defaultConfig.resolver.blockList = [
    /@signumjs\/crypto\/adapters\/.+$/
];
module.exports = defaultConfig;
  1. Initialize the Crypto Module to use the "native" Expo Crypto Adapter

In your entry point of your application, e.g. ./app/_layout.tsx you have to add the following code:

/**
 * The next steps are required to initialize signumjs/crypto module for Expo
 */
import {Crypto} from '@signumjs/crypto'
import {ReactNativeExpoCryptoAdapter} from "@signumjs/react-native-expo-crypto-adapter"

Crypto.init(new ReactNativeExpoCryptoAdapter());

Example

Find a complete example app here

Troubleshooting

About

This is the React Native implementation of the CryptoAdapter for @signumjs/crypto

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages