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

@ramper/react-native-core

v1.0.4

Published

Ramper's React Native SDK helps developers and provide access to the Blockchain through SSO for non-native crypto users.

Downloads

16

Readme

Ramper SDK for React Native

Note: This SDK is supported on iOS 14 and above.

Installation

npm

$ npm install @ramper/react-native-core

yarn

$ yarn add @ramper/react-native-core

Installing peer dependencies

$ yarn add query-string react-native-keychain react-native-inappbrowser-reborn @react-native-community/clipboard @react-navigation/bottom-tabs @react-navigation/native @react-navigation/stack accordion-collapse-react-native date-fns react-native-raw-bottom-sheet react-query react-native-gesture-handler react-native-safe-area-context react-native-screens react-native-device-info

Note: follow the further installation steps of react-native-inappbrowser-reborn & react-navigation

Step 1

$ cd ios && pod install

Step 2

Secondly, our SDK uses deep links to communicate back with your application. In order to Configure Deep Links, you will need to get an app id by signing up at deleveroper dashboard and apply the following steps:

iOS

Add the below code in your AppDelegate.m file

// Add the header at the top of the file:
#import <React/RCTLinkingManager.h>

// Add this above `@end`:
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  return [RCTLinkingManager application:application openURL:url options:options];
}

Copy your bundle id as shown in the below screenshot: Alt text

Paste your bundle id in identifier section and add ramper<appId> in the URI Scheme section: Make sure to not include the brackets <> in the URLScheme Alt text

Android

Add the following in your project/adnroid/app/src/main/AndroidManifest.xml file under Activity Tag

      <intent-filter>
      <!--  Make sure to not include the brackets <> in the scheme -->
        <data android:scheme="ramper<appId>" />
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
      </intent-filter>

Run your app

iOS

$ npx react-native run-ios

Android

$ npx react-native run-android

Usage

In your starting file import Ramper as below

import { Ramper } from '@ramper/react-native-core';

call configure passing your appId (required), locale (default: en), chainName (required)

Ramper.configure({
  appId: 'appId',
  locale: 'kr' | 'ko' | 'en',
  chainName: 'ethereum',
  network: 'matic' | 'maticmum' | 'mainnet' | 'ropsten' | 'goerli',
});

Authentication

Show Sign In Screen

We have a pre-built screen that you can use to display all the sign in options for the customer:

import { RamperScreen } from '@ramper/react-native-core';
<RamperScreen
  providers={[
    {
      name: 'google' | 'facebook' | 'twitter' | 'apple',
    },
  ]}
  theme="light | dark"
  onSuccess={(user) => {
    //handle user
  }}
  onFailure={(error) => {
    // handle error
  }}
  onClose={() => {}}
  logo={require('mylogo') | { uri: 'mylogourl' }}
  browserProps // optional
/>

Check supported browser props for iOS and Android

Signing In Directly

If you want to create a custom Sign In page and only allow the user to sign in with a specific provider, you can invoke the signin method directly instead.

import { Auth } from '@ramper/react-native-core';

Auth.signin accecpts two parameters Provider (google | facebook | twitter | apple), browserProps (optional): check supported browser props for iOS and Android

try {
  let response = await Auth.signin(
    'google' | 'facebook' | 'twitter' | 'apple',
    browserProps //optional,
  );
  // handle response
} catch (error) {
  // handle error
}

Get User

After a user logs in or on app relaunch, you can call the getUser method to get the currently logged-in user's information.

try {
  let user = await Auth.getUser();
  // handle user
} catch (error) {
  // handle error
}

Wallet View

We also provide a Wallet View that allows your user to see their Ethereum wallet balance and conduct common actions.

Step 1

$ yarn add @ramper/react-native-evm

Note: follow the further installation instruction of @ramper/react-native-evm

Step 2

import { WalletView } from '@ramper/react-native-core';
import { EthDataProvider } from '@ramper/react-native-evm';

Step 3

Use the wallet view component like this

<WalletView
  dataProviders={[{ name: 'ethereum', dataProvider: EthDataProvider }]}
  onCLose={() => {}} // will be called when the user clicks on the close button of wallet view
/>

Note: before using this component please make sure that the user is logged in by calling getUser method mentioned above.

Transactions

Please refer to @ramper/react-native-evm for transaction instructions.

Sign Out

import { Auth } from '@ramper/react-native-core';

try {
  const signout = await Auth.signOut(
    browserProps //optional
  );
  // handle signout
} catch (error) {
  // handle error
}