Skip to content

Does this library support React Native? #111

Open
@salman-kryptomind

Description

@salman-kryptomind

I'm trying to create Dash Wallet App with React Native but I'm getting following error

Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules

The only thing seems to causing error is "fs" module which is not supported in react-native.

Expected Behavior

It's not working correctly while generating mnemonic.

Current Behavior

Getting following error
Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a react-native project ( npx react-native init AwesomeTSProject --template react-native-template-typescript )
  2. Install rn-nodefy in react-native project and hack the Node so you can use node core module ( https://www.npmjs.com/package/rn-nodeify )
  3. npm install dash
  4. Generate Mnemonic using following code
    import Dash from 'dash';
    const client = new Dash.Client({
    network: 'testnet',
    wallet: {
    mnemonic: null,
    },
    });
    const mnemonic = client.wallet?.exportWallet();

Context

I'm not able to use dash sdk since It was the main ingredient to create dash wallet and add functionalities like send/receive and get transactions.

Your Environment

  • Version used: 3.21.2
  • Environment name and version (e.g. Chrome 39, node.js 5.4): Node : v14.18.1, React-Native: 0.66.1
  • Operating System and version (desktop, server, or mobile): Android/IOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    js-sdkJS Dash SDK related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions