Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update rn sdk dependencies and ease install #834

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};