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

@cybavo/react-native-wallet-service

v1.2.301

Published

React version of CYBAVO WALLET SDK

Downloads

101

Readme

@cybavo/react-native-wallet-service

React-native version of CYBAVO Wallet SDK. Learn more on our website: https://www.cybavo.com/wallet-app-sdk/

Institutional-grade security for your customers

Protect your customers’ wallets with the same robust technology we use to protect the most important cryptocurrency exchanges. CYBAVO Wallet App SDK allows you to develop your own cryptocurrency wallet, backed by CYBAVO private key protection technology.

Mobile SDK

Use CYBAVO Wallet App SDK to easily develop secure wallets for your users without having to code any cryptography on your side. Our SDK allows you to perform the most common operations, such as creating a wallet, querying balances and executing cryptocurrency payments.

Secure key management system

Key management is the most critical part of cryptocurrency storage. CYBAVO Wallet App SDK makes our robust private key storage system available to all of your users. Our unique encryption scheme and a shared responsibility model offers top notch protection for your customer’s keys.

CYBAVO Security Cloud

Cryptocurrency transactions performed by wallets developed with CYBAVO Wallet App SDK will be shielded by our Security Cloud, ensuring their integrity.

Complete solution for cryptocurrency wallets

Cost saving

Leverage your in-house developing team and develop mobile cryptocurrency apps without compromising on security.

Fast development

Quickly and easily develop cryptocurrency applications using mobile native languages, without having to worry about cryptographic code.

Full Node maintenance

Leverage CYBAVO Wallet App SDK infrastructure and avoid maintaining a full node for your application.

Feel free to contact us for product inquiries or mail us: [email protected]

CYBAVO

A group of cybersecurity experts making crypto-currency wallet secure and usable for your daily business operation.

We provide VAULT, wallet, ledger service for cryptocurrency. Trusted by many exchanges and stable-coin ico teams, please feel free to contact us when your company or business need any help in cryptocurrency operation.

Getting started

$ npm install @cybavo/react-native-wallet-service --save

  1. Polyfill NodeJS modules for React-Native
    $ yarn add rn-nodeify
    $ rn-nodeify --install --hack
  2. unmark require('crypto') in shim.js

Mostly automatic installation

$ react-native link @cybavo/react-native-wallet-service

Manual installation

iOS

  1. Append this line in Podfile:
    pod 'CybavoWalletService', :path => "../node_modules/@cybavo/react-native-wallet-service/ios/CybavoWalletService.podspec"
  2. Go to ./ios, run pod install to install all dependencies.
  3. Open ./ios/{{your project}}.xcworkspace in XCode
  4. In XCode, run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.cybavo.reactnative.wallet.service.CybavoWalletServicePackage; to the imports at the top of the file
  • Add new CybavoWalletServicePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':@cybavo/react-native-wallet-service'
    project(':@cybavo/react-native-wallet-service').projectDir = new File(rootProject.projectDir, 	'../node_modules/@cybavo/react-native-wallet-service/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':@cybavo/react-native-wallet-service')

Usage

import { WalletSdk, Auth, Wallets } from "@cybavo/react-native-wallet-service";

WalletConnect

CYBAVO Wallet App SDK has integrated WalletConnect to support wallet apps connecting with Dapps (Web3 Apps).

  1. Following code snippet is the simple usage of how to new a session, approve session request and approve call request

    For further technical specification, please refer to WalletConnect's official document

    import { WalletConnectSdk } from "@cybavo/react-native-wallet-service";
    const { WalletConnectManager, WalletConnectHelper } = WalletConnectSdk;
    // Establish session, then the callback will receive session request 
    let connectorWrapper = WalletConnectManager.newSession(
            walletConnectUri,
            walletAddress,
            walletId,
            walletClientMeta,
            (error, payload) => {
                sessionRequestCallback(connectorWrapper.getConnector().peerId, error, payload);
            }
          );
       
    let sessionRequestCallback = (peerId, error, payload) => {
        //approve session, then pass the listeners to receive call request and disconnect event
        WalletConnectManager.approveSession(
              peerId,
              {
                accounts: [walletAddress],
                chainId: 1, //main net
              },
              (error: any, payload: any) => {
                    callRequestListener(peerId, error, payload);
              },
              disconnectListener
        )
    }
    let callRequestListener = (peerId, error: any, payload: any) => {
        WalletConnectManager.approveRequest(peerId, response).then(() => {})
    }
    let disconnectListener = (error: any, payload: any) => {}
  2. API to support handling call request

    Here defined methods that wallet app should implement. We also provided API to handle corresponding methods:

    • personal_sign, eth_sign
    let message = payload.params[0];
    let result = await Wallets.walletConnectSignMessage(
           walletId,
           convertHexToUtf8(message),
           pinSecret
         );
    • eth_sendTransaction
    let tx = payload.params[0];
    // 1. sign transaction
    let result = await Wallets.walletConnectSignTransaction(
           walletId,
           tx,
           transactionFee,
           pinSecret
         );
    // 2. send signed transaction
    let sendResult = await Wallets.walletConnectSendSignedTransaction(
                walletId,
                result.signedTx
              );
    // return TXID as approve response to the Dapp
    let response = { result: sendResult.txid, id: payload.id };
    await WalletConnectManager.approveRequest(peerId, response);
      
    • eth_signTypedData
    let message = payload.params[1];
         let result = await Wallets.walletConnectSignTypedData(
           walletId,
           message,
           pinSecret
         );
    let response = { result: '0x' + result.signedTx, id: payload.id };
    await WalletConnectManager.approveRequest(peerId, response);
    • eth_sendRawTransaction
    let signedTx = params[0];
    let sendResult = await Wallets.walletConnectSendSignedTransaction(
                walletId,
                signedTx
              );
    // return TXID as approve response to the Dapp
    let response = { result: sendResult.txid, id: payload.id };
    await WalletConnectManager.approveRequest(peerId, response);
    • eth_signTransaction
    let tx = payload.params[0];
    let result = await Wallets.walletConnectSignTransaction(
           walletId,
           tx,
           transactionFee,
           pinSecret
         );
     let response = { result: result.signedTx, id: payload.id };
     await WalletConnectManager.approveRequest(peerId, response);
  3. Other supportive API

    • Wallets.walletConnectSync

      Check if there're any changes after transactions committed through Wallets.walletConnectSendSignedTransaction or Wallets.sendSignedTx and perform the updates.

    • Wallets.getWalletConnectApiHistory

      All walletconnect related API will be logged as ApiHistoryItem with vary API Names. Use Wallets.getWalletConnectApiHistory to fetch API histories.

    • Wallets.cancelWalletConnectTransaction

      Use Wallets.cancelWalletConnectTransaction to cancel a pending transaction which sent through Wallets.walletConnectSendSignedTransaction.

      It's required a higher transaction fee (1.1 times) to replace the original transaction with 0 amount.

Check our sample app on GitHub: https://github.com/CYBAVO/react-native_wallet_sdk_sample

Refer to documents for details of extra parameters.