Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@beincom/rn-wallet-sdk

Package Overview
Dependencies
Maintainers
12
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beincom/rn-wallet-sdk

latest
npmnpm
Version
0.0.50
Version published
Maintainers
12
Created
Source



BIC Chain SDK TypeScript monorepo

Build Status

Wallet SDKs for Browser and Mobile apps

Installation

Install the latest version of the SDK with npm:

npm install @beincom/rn-wallet-sdk

or with yarn:

yarn add @beincom/rn-wallet-sdk

dependencies:

{
  "dependencies": {
    "@ethersproject/shims": "^5.7.0",
    "@react-native-community/netinfo": "^10.0.0",
    "amazon-cognito-identity-js": "6.3.3",
    "ethers": "^5",
    "expo": "^49.0.3",
    "node-libs-browser": "^2.2.1",
    "react": "18.2.0",
    "react-native": "0.72.6",
    "react-native-aes-gcm-crypto": "^0.2.2",
    "react-native-crypto": "^2.2.0",
    "react-native-get-random-values": "^1.9.0",
    "react-native-quick-base64": "^2.0.7",
    "react-native-quick-crypto": "^0.6.1",
    "react-native-randombytes": "^3.6.1"
  }
}

Config

1. Create shims.js and import it to root (react-native-compact)

// shims.js
import "react-native-get-random-values";
import "@ethersproject/shims";
if (typeof BigInt === "undefined") {
    global.BigInt = require("big-integer");
}
if (typeof Buffer === "undefined") {
    global.Buffer = require("buffer").Buffer;
}

// @ts-ignore: Unreachable code error
global.process.version = "v0.9";
if (typeof process === "undefined") {
    global.process = require("process");
}
global.btoa = global.btoa || require("base-64").encode;
global.atob = global.atob || require("base-64").decode;

// index.js
import "./shims";

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

2. add config to metro.config.js

const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

/**
 * Metro configuration
 * https://facebook.github.io/metro/docs/configuration
 *
 * @type {import('metro-config').MetroConfig}
 */
const extraNodeModules = require('node-libs-browser');

const config = {
  resolver: {
    extraNodeModules,
  },
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);

Quick start

1. Create wallet instance.

import axios from "axios";
import { BICWallet, ThirdwebProvider, WalletAPI, ArbitrumSepolia } from "@beincom/wallet-sdk";
// create wallet backend api client.
const api = new WalletAPI({
  endpoint: "",// endpoint wallet backend
  httpClient: axios //axios instance
});
// create wallet provider client.
const provider = new ThirdwebProvider(
  "", // provider key
  ArbitrumSepolia // network
);
// create BIC wallet instance.
const bicWallet = new BICWallet({
  api: api,
  provider: provider
})

Documentation

Visit docs to view the full documentation.

Keywords

react-native

FAQs

Package last updated on 21 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