0.0.50 • Published 1 year ago

@beincom/rn-wallet-sdk v0.0.50

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
1 year ago

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.

0.0.50

1 year ago

0.0.49

1 year ago

0.0.47

1 year ago

0.0.48

1 year ago

0.0.46

1 year ago

0.0.45

1 year ago

0.0.44

1 year ago

0.0.43

1 year ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.39

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.34

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.25

1 year ago

0.0.26

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago