1.0.4 • Published 1 month ago

@signumjs/react-native-expo-crypto-adapter v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 month ago

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

1.0.4

1 month ago

1.0.3

1 month ago

1.0.2

5 months ago

1.0.1

6 months ago

1.0.0

6 months ago