Skip to content

Commit

Permalink
chore: update rn sdk dependencies and ease install
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashshah committed Nov 14, 2023
1 parent 2bdacdd commit f13c1e2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/reactnative/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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": {
Expand Down
12 changes: 12 additions & 0 deletions packages/reactnative/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -133,6 +135,15 @@ const genRandomAddress = async () => {

const profileUpgrade = PushApi.user.auth.update;

const PushRNWrapper = ({ children }: { children: React.ReactNode }) => {
return (
<React.Fragment>
<WebViewCrypto />
{children}
</React.Fragment>
);
};

export {
PGPHelper,
genRandomAddress,
Expand All @@ -153,4 +164,5 @@ export {
send,
approve,
Constants,
PushRNWrapper,
};

0 comments on commit f13c1e2

Please sign in to comment.