https://github.com/docknetwork/react-native-sdk
https://github.com/docknetwork/react-native-sdk
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/docknetwork/react-native-sdk
- Owner: docknetwork
- License: other
- Created: 2021-06-10T21:00:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-15T13:45:46.000Z (about 1 year ago)
- Last Synced: 2025-04-15T14:43:42.805Z (about 1 year ago)
- Language: TypeScript
- Size: 28.1 MB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Truvera Wallet SDK
The [Wallet SDK](https://github.com/docknetwork/react-native-sdk) enables you to build a Verifiable Credentials wallet inside your app and allows your users to receive, store, and manage their DOCK tokens too. This was built for mobile applications with added support for Polkadot-JS.
To use the wallet-sdk, all you need to do is wrap your app in a `WalletSDKProvider` and start building your wallet.
Using [polkadot-js](https://polkadot.js.org/) libraries in React Native is a challenge, due to the lack of WebAssembly support.
The Truvera Wallet SDK handles all the Polkadot Web Assembly in a WebView, sending messages to the React Native thread through a JSON RPC layer.
Truvera Mobile SDK supports:
- Devices that have Android 8.1 or higher and iOS 11 or higher.
- Minimum supported version of Node.js is 20.2.0
## Installation
```js
yarn add @docknetwork/wallet-sdk-core
yarn add @docknetwork/wallet-sdk-react-native
```
**There are some scripts and additional dependencies required.**
Please check our [example repo](https://github.com/docknetwork/wallet-sdk-demo) for detailed steps.
## React Native Example
The following example will create a wallet and allow the user to add credentials to it. Displaying the count of documents added to the wallet.
Notice that the all documents are accessible through the `documents` object.
```js
import {Box, Button, NativeBaseProvider, Text} from 'native-base';
import React, {useEffect} from 'react';
import {
WalletSDKProvider,
useWallet,
} from '@docknetwork/wallet-sdk-react-native/lib';
const WalletDetails = function () {
const {wallet, status, documents} = useWallet();
return (
Wallet status: {status}
Wallet docs: {documents.length}
wallet.addDocument({
name: 'my credential',
type: 'VerifiableCredential',
})}>
Add Credential
);
};
const App = () => {
return (
Dock Wallet SDK Demo
Press on `add credential` button to create a new credential
);
};
export default App;
```
## Running on other platforms
Check the following repository for detailed examples for running the Truvera Wallet SDK on NodeJS, Web, and Flutter.
[See the examples](https://github.com/docknetwork/wallet-sdk-examples)
## Docs
For more details you can check the [getting started guide](https://github.com/docknetwork/react-native-sdk/blob/master/docs/getting-started.md)
[See the Github repository](https://docknetwork.github.io/react-native-sdk/)
## Features
- [Biometric Plugin](https://github.com/docknetwork/react-native-sdk/blob/master/docs/biometric-plugin.md)
- [Ecosystem Tools](https://github.com/docknetwork/react-native-sdk/blob/master/docs/ecosystem-tools.md)
- [Cloud Wallet](https://github.com/docknetwork/react-native-sdk/blob/master/docs/cloud-wallet.md)