From f13c1e258313a25e532e33af469aacce97e9407f Mon Sep 17 00:00:00 2001 From: kalashshah <202051096@iiitvadodara.ac.in> Date: Tue, 14 Nov 2023 12:04:06 +0530 Subject: [PATCH] chore: update rn sdk dependencies and ease install --- packages/reactnative/package.json | 13 ++++++++----- packages/reactnative/src/index.tsx | 12 ++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/reactnative/package.json b/packages/reactnative/package.json index 79b77f1fd..64a44772c 100644 --- a/packages/reactnative/package.json +++ b/packages/reactnative/package.json @@ -49,7 +49,7 @@ "example": "yarn --cwd example", "bootstrap": "yarn example && yarn install", "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build", - "postinstall": "node_modules/.bin/rn-nodeify --install crypto,assert,url,stream,events,http,https,os,url,net,fs --hack && patch-package" + "postinstall": "node_modules/.bin/rn-nodeify --install crypto,assert,url,stream,events,http,https,os,url,net,fs --hack && npx patch-package" }, "keywords": [ "react-native", @@ -67,9 +67,10 @@ "registry": "https://registry.npmjs.org/" }, "dependencies": { - "@pushprotocol/restapi": "../../dist/packages/restapi", + "@kalashshah/restapi": "0.1.2", "@tradle/react-native-http": "^2.0.1", "assert": "^1.5.0", + "axios": "^0.27.2", "crypto": "^1.0.1", "crypto-js": "3.1.9-1", "ethers": "^5.7.1", @@ -83,13 +84,16 @@ "react-native-os": "^1.2.6", "react-native-randombytes": "^3.6.1", "react-native-tcp": "^3.3.2", - "react-native-webview": "^11.26.1", + "react-native-webview": "^13.2.2", "react-native-webview-crypto": "^0.0.25", "readable-stream": "^1.0.33", + "rn-nodeify": "^10.3.0", "stream": "^0.0.2", "stream-browserify": "^1.0.0", "text-encoding": "0.7.0", - "url": "^0.10.3" + "url": "^0.10.3", + "uuid": "^9.0.0", + "viem": "^1.3.0" }, "devDependencies": { "@commitlint/config-conventional": "^17.0.2", @@ -113,7 +117,6 @@ "react-native": "0.71.11", "react-native-builder-bob": "^0.20.4", "release-it": "^15.0.0", - "rn-nodeify": "^10.3.0", "typescript": "^4.5.2" }, "resolutions": { diff --git a/packages/reactnative/src/index.tsx b/packages/reactnative/src/index.tsx index a8ab90ee0..0e7954d9d 100644 --- a/packages/reactnative/src/index.tsx +++ b/packages/reactnative/src/index.tsx @@ -3,7 +3,9 @@ import 'text-encoding'; import 'react-native-crypto'; import 'react-native-get-random-values'; +import React from 'react'; import OpenPGP from 'react-native-fast-openpgp'; +import WebViewCrypto from 'react-native-webview-crypto'; import { ethers } from 'ethers'; import * as PushApi from '@pushprotocol/restapi'; @@ -133,6 +135,15 @@ const genRandomAddress = async () => { const profileUpgrade = PushApi.user.auth.update; +const PushRNWrapper = ({ children }: { children: React.ReactNode }) => { + return ( + + + {children} + + ); +}; + export { PGPHelper, genRandomAddress, @@ -153,4 +164,5 @@ export { send, approve, Constants, + PushRNWrapper, };