Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-address-generator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-address-generator

A Bitcoin Address Generator for React Native Projects.

  • 0.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-address-generator

A Bitcoin Address Generator for React Native Projects.

Installation

npm install react-native-address-generator

Usage

import { getAddress, getScriptHash, getPrivateKey } from 'react-native-address-generator';

const mnemonic =
  'lazy rally chat way pet outside flame cup oval absurd innocent balcony';
const passphrase = 'passphrase';
const path = "m/84'/1'/0'/0/0";
const network = 'testnet';

const getAddressRes = await getAddress({
  mnemonic,
  path,
  network,
  passphrase,
});
if (getAddressRes.isErr()) {
  console.log(getAddressRes.error.message);
  return;
}
console.log(getAddressRes.value);

const address = getAddressRes.value.address;

const getScriptHashRes = await getScriptHash({
  address,
  network,
});
if (getScriptHashRes.isErr()) {
  console.log(getScriptHashRes.error.message);
  return;
}
console.log(getScriptHashRes.value);

const getPrivateKeyRes = await getPrivateKey({
  mnemonic,
  path,
  network,
  passphrase,
});
if (getPrivateKeyRes.isErr()) {
  console.log(getPrivateKeyRes.error.message);
  return;
}
console.log(getPrivateKeyRes.value);

Update Bindings

After making changes to any of the Rust files, the bindings will need to be updated. To do this, run the following command:

npm run update-bindings

Finally, ensure that AddressGeneratorModule.kt, AddressGenerator.swift, AddressGenerator.mm & src/index.tsx are updated accordingly based on the changes made to the Rust files.

License

MIT


Resources

  • Project created with: create-react-native-library
  • Building an Android App with Rust Using UniFFI
  • Building an iOS App with Rust Using UniFFI

Keywords

FAQs

Package last updated on 09 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc