Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@digiv3rse/react-native
Advanced tools
The official DiGi Protocol React bindings for React Native.
This package enables you to build mobile applications on top of the DiGi Protocol using React Native.
Install the DiGi React Native SDK package using your package manager of choice:
Package Manager | Command |
---|---|
npm | npm install @digiv3rse/react-native@latest |
yarn | yarn add @digiv3rse/react-native@latest |
pnpm | pnpm add @digiv3rse/react-native@latest |
First we need to create so-called bindings. Bindings are just an object implementing the IBindings
interface. This is used by the DiGi SDK to access the Signer and the Provider.
In this example we will limit ourselves to the bare minimum and we will use the ethers.js
library to create the bindings.
// wallet.ts
import { IBindings } from '@digiv3rse/react-native';
import { providers, Wallet } from 'ethers';
const provider = new providers.InfuraProvider('maticmum');
const wallet = new Wallet('<your-private-key>', provider);
export const bindings: IBindings = {
getProvider: async () => provider,
getSigner: async () => wallet,
};
Create the DiGiConfig
. In this example we will use react-native-mmkk
as underlying storage. You can use any storage you want as long as it implements the IStorageProvider
interface.
First install the react-native-mmkv
package:
Package Manager | Command |
---|---|
npm | npm install react-native-mmkv |
yarn | yarn add react-native-mmkv |
pnpm | pnpm add react-native-mmkv |
Create the DiGiConfig
object:
import { DiGiConfig, development } from '@digiv3rse/react-web';
import { storage } from '@digiv3rse/react-web/storage/mmkv';
import { bindings } from './wallet.ts';
const lensConfig: DiGiConfig = {
bindings,
environment: development,
storage: storage(),
};
Wrap your app with the <DiGiProvider>
and pass the DiGiConfig
as a prop.
import { DiGiProvider } from '@digiv3rse/react-web';
function App() {
return (
<DiGiProvider config={lensConfig}>
<YourApp />
</DiGiProvider>
);
}
FAQs
DiGi Protocol SDK for React Native
The npm package @digiv3rse/react-native receives a total of 3 weekly downloads. As such, @digiv3rse/react-native popularity was classified as not popular.
We found that @digiv3rse/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.