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

xdcnetwork-mobilesdk

v1.0.0

Published

test

Downloads

1

Readme

Overview

The XDC Mobile SDK is a key component of the XDC Wallet Protocol that allows developers to retake control of the user experience by eliminating the reliance for end-users to complete complex blockchain operations through third party apps. By utilizing the SDK, developers gain access to the necessary tools that enable them to create familiar and native mobile UX while leveraging the benefits of blockchain technology.

The XDC Mobile SDK makes it easy to create web3 mobile apps by: Simplifying self-custody: Create performative EOAs (Externally Owned Accounts) under the hood, stored on the user's device, and secured by native OS technology.

Supported blockchains and tokens

  • XDC
  • More coming soon

Supported languages

  • React Native
  • Expo
  • More coming soon

Installation

Install with npm

 npm install xdcnetwork-mobilesdk

Install required dependencies:

 npm install --save react-native-keychain

 npm install --save react-native-get-random-values

 //for IOS
 npx pod-install

Get Started

Create a crypto account

Generate an EOA on-device at device + application level.

import { createAccount } from 'xdcnetwork-mobilesdk';

const newAccount = await createAccount();

Get the public address

Get the public address of the EOA generated by the SDK.

import { getAccount } from 'xdcnetwork-mobilesdk';

const account = await getAccount();

Displaying seed phrases

Display the seed phrase to users to enable users to import their crypto account an external wallet app.

import { getAccountPhrase } from 'xdcnetwork-mobilesdk';

const mnemonic = await getAccountPhrase();

How it Works

Creation

The account generation process uses the BIP39 mnemonic generation to create a hierarchical-deterministic (HD) wallet. This mnemonic is used to extract a private key from the BIP32 path "m/44'/60'/0'/0/0" which is the Ethereum default path.

This generation process uses the same methodologies as ethers js, with a couple of key differences:

  • The generation of the mnemonic and the extraction of the private key are both done in native code, with C being used on the iOS side and Kotlin on the Android side.
  • The private key from our NativeModule is passed over to the JavaScript side to instantiate an ethers js wallet using the private key.

The above approach bypasses the performance issues that occur when performing big int math in javascript within a React Native app. The generated ethers js wallet does not have access to the mnemonic, it is not able to create a second wallet with a different path.

Persistence

On device only

Private keys are generated at the app + device level, and if the user uninstalls and reinstalls the application on the same device, the same private key will be used. However, if the user reinstalls the app on a different device, a new private key will be generated.

Cloud recovery enabled

Developers who opt in to utilize iOS or Google's cloud recovery will generate a private key at the device + cloud account level. Users are able to utilize the same crypto account on multiple devices as long as they are logged into their cloud account on their device.

Encryption & Storage

Private key storage makes use of hardware encryption and low level OS key storage technology on device.