Browse Source

Merge branch 'master' into swipee2

atmfinder
Overtorment 5 years ago
committed by GitHub
parent
commit
347c2562e4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      README.md
  2. 16
      ios/Podfile.lock
  3. 114
      package-lock.json
  4. 10
      package.json
  5. 116
      screen/wallets/selectWallet.js

9
README.md

@ -25,10 +25,15 @@ Community: [telegram group](https://t.me/bluewallet)
<img src="https://i.imgur.com/hHYJnMj.png" width="100%">
## BUILD & RUN IT
Please refer to the engines field in package.json file for the minimum required versions of Node and npm. It is preferred that you use an even-numbered version of Node as these are LTS versions.
To view the version of Node and npm in your environment, run the following in your console:
## BUILD & RUN IT
```
node --version && npm --version
```
* In your console:
@ -38,6 +43,8 @@ cd BlueWallet
npm install
```
Please make sure that your console is running the most stable versions of npm and node (even-numbered versions).
* To run on Android:
You will now need to either connect an Android device to your computer or run an emulated Android device using AVD Manager which comes shipped with Android Studio. To run an emulator using AVD Manager:

16
ios/Podfile.lock

@ -82,7 +82,7 @@ PODS:
- React
- react-native-randombytes (3.5.3):
- React
- react-native-slider (2.0.0-rc.1):
- react-native-slider (2.0.8):
- React
- react-native-webview (6.9.0):
- React
@ -125,13 +125,13 @@ PODS:
- React
- RNHandoff (0.0.3):
- React
- RNQuickAction (0.3.12):
- RNQuickAction (0.3.13):
- React
- RNRate (1.0.1):
- React
- RNSecureKeyStore (1.0.0):
- React
- RNSentry (1.0.9):
- RNSentry (1.2.1):
- React
- Sentry (~> 4.4.0)
- RNShare (2.0.0):
@ -140,7 +140,7 @@ PODS:
- React
- RNVectorIcons (6.6.0):
- React
- RNWatch (0.4.1):
- RNWatch (0.4.2):
- React
- Sentry (4.4.3):
- Sentry/Core (= 4.4.3)
@ -334,7 +334,7 @@ SPEC CHECKSUMS:
react-native-haptic-feedback: 22c9dc85fd8059f83bf9edd9212ac4bd4ae6074d
react-native-image-picker: 3637d63fef7e32a230141ab4660d3ceb773c824f
react-native-randombytes: 991545e6eaaf700b4ee384c291ef3d572e0b2ca8
react-native-slider: 6d83f7b8076a84e965a43fbdcfcf9dac19cea42e
react-native-slider: b2f361499888302147205f17f6fffa921a7bda70
react-native-webview: f72ac4078e115dfa741cc588acb1cca25566457d
React-RCTActionSheet: b0f1ea83f4bf75fb966eae9bfc47b78c8d3efd90
React-RCTAnimation: 359ba1b5690b1e87cc173558a78e82d35919333e
@ -354,14 +354,14 @@ SPEC CHECKSUMS:
RNFS: c9bbde46b0d59619f8e7b735991c60e0f73d22c1
RNGestureHandler: 5329a942fce3d41c68b84c2c2276ce06a696d8b0
RNHandoff: d3b0754cca3a6bcd9b25f544f733f7f033ccf5fa
RNQuickAction: eca9a5dd04b5cdf8a0dd32d8be8844dc33aba2bd
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNRate: 29be49c24b314c4e8ec09d848c3965f61cb0be47
RNSecureKeyStore: f1ad870e53806453039f650720d2845c678d89c8
RNSentry: 2803ba8c8129dcf26b79e9b4d8c80168be6e4390
RNSentry: 9b1d983b2d5d1c215ba6490348fd2a4cc23a8a9d
RNShare: 8b171d4b43c1d886917fdd303bf7a4b87167b05c
RNSVG: 0eb087cfb5d7937be93c45b163b26352a647e681
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
RNWatch: a14e378448e187cc12f307f61d41fe8a65400e86
RNWatch: a36ea17fac675b98b1d8cd41604af68cf1fa9a03
Sentry: 14bdd673870e8cf64932b149fad5bbbf39a9b390
swift_qrcodejs: 4d024fc98b0778b804ec6a5c810880fd092aec9d
TcpSockets: 8d839b9b14f6f344d98e4642ded13ab3112b462d

114
package-lock.json

@ -1211,9 +1211,9 @@
"integrity": "sha512-EJGsbrHubK1mGxPjWB74AaHAd5m9I+Gg2RRPZzMK6org7QOU9WOBnIMFqoeVto3hKOaEPlk8NV74H6G34/2pZQ=="
},
"@react-native-community/blur": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/@react-native-community/blur/-/blur-3.3.1.tgz",
"integrity": "sha512-UfH2ut/l4GpZHeq/TGx3BrmyXSCSBBwBCVx1DhPodP3k959zJ2ajgXa3PiU/qjutftTUw6KH9Frsh2U0ax9dMQ==",
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/@react-native-community/blur/-/blur-3.4.1.tgz",
"integrity": "sha512-XhbS230J7BGuoEamjPFZ5jUWDOW16y+vD0Soyq9Iv1qL8R47esGl54bnfUSMH10WhNXrQzvPxkMzap+ONHpE2w==",
"requires": {
"prop-types": "^15.5.10"
}
@ -1330,9 +1330,9 @@
}
},
"@react-native-community/slider": {
"version": "2.0.0-rc.1",
"resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-2.0.0-rc.1.tgz",
"integrity": "sha512-hdqQavGovI5M9NjCj4q4SPXyYOEHpBGXLIHBFETyL0S/B96hb09MXZAhOxsPYYs8KamYSKh2IYKwZ8yEiikNSg=="
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/@react-native-community/slider/-/slider-2.0.8.tgz",
"integrity": "sha512-FZC3wjYzHQiD7jT7ALy3QNccyLj9zQBRiKGBFr/QvrWLkVg5orpIJ53aYFXm3eOkNvUV+wjhoI9uCkh3LCN2+A=="
},
"@react-navigation/core": {
"version": "3.4.2",
@ -1395,13 +1395,13 @@
"from": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git"
},
"@sentry/browser": {
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.9.1.tgz",
"integrity": "sha512-7AOabwp9yAH9h6Xe6TfDwlLxHbUSWs+SPWHI7bPlht2yDSAqkXYGSzRr5X0XQJX9oBQdx2cEPMqHyJrbNaP/og==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.10.2.tgz",
"integrity": "sha512-r3eyBu2ln7odvWtXARCZPzpuGrKsD6U9F3gKTu4xdFkA0swSLUvS7AC2FUksj/1BE23y+eB/zzPT+RYJ58tidA==",
"requires": {
"@sentry/core": "5.8.0",
"@sentry/types": "5.7.1",
"@sentry/utils": "5.8.0",
"@sentry/core": "5.10.2",
"@sentry/types": "5.10.0",
"@sentry/utils": "5.10.2",
"tslib": "^1.9.3"
}
},
@ -1419,71 +1419,71 @@
}
},
"@sentry/core": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.8.0.tgz",
"integrity": "sha512-aAh2KLidIXJVGrxmHSVq2eVKbu7tZiYn5ylW6yzJXFetS5z4MA+JYaSBaG2inVYDEEqqMIkb17TyWxxziUDieg==",
"requires": {
"@sentry/hub": "5.8.0",
"@sentry/minimal": "5.8.0",
"@sentry/types": "5.7.1",
"@sentry/utils": "5.8.0",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.10.2.tgz",
"integrity": "sha512-sKVeFH3v8K8xw2vM5MKMnnyAAwih+JSE3pbNL0CcCCA+/SwX+3jeAo2BhgXev2SAR/TjWW+wmeC9TdIW7KyYbg==",
"requires": {
"@sentry/hub": "5.10.2",
"@sentry/minimal": "5.10.2",
"@sentry/types": "5.10.0",
"@sentry/utils": "5.10.2",
"tslib": "^1.9.3"
}
},
"@sentry/hub": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.8.0.tgz",
"integrity": "sha512-VdApn1ZCNwH1wwQwoO6pu53PM/qgHG+DQege0hbByluImpLBhAj9w50nXnF/8KzV4UoMIVbzCb6jXzMRmqqp9A==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.10.2.tgz",
"integrity": "sha512-hSlZIiu3hcR/I5yEhlpN9C0nip+U7hiRzRzUQaBiHO4YG4TC58NqnOPR89D/ekiuHIXzFpjW9OQmqtAMRoSUYA==",
"requires": {
"@sentry/types": "5.7.1",
"@sentry/utils": "5.8.0",
"@sentry/types": "5.10.0",
"@sentry/utils": "5.10.2",
"tslib": "^1.9.3"
}
},
"@sentry/integrations": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-5.8.0.tgz",
"integrity": "sha512-Obe3GqTtq63PAJ4opYEbeZ6Bm8uw+CND+7MywJLDguqnvIVRvxpcJIZ6wxcE/VjbU3OMkNmTMnM+ra8RB7Wj6w==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-5.10.2.tgz",
"integrity": "sha512-yvIJ6aXpzWlwD1WGTxvaeCm7JmNs4flWXKLlPWm2CEwgWBfjyaWjW7PqlA0jUOnLGCeYzgFD3AdUPlpgCsFXXA==",
"requires": {
"@sentry/types": "5.7.1",
"@sentry/utils": "5.8.0",
"@sentry/types": "5.10.0",
"@sentry/utils": "5.10.2",
"tslib": "^1.9.3"
}
},
"@sentry/minimal": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.8.0.tgz",
"integrity": "sha512-MIlFOgd+JvAUrBBmq7vr9ovRH1HvckhnwzHdoUPpKRBN+rQgTyZy1o6+kA2fASCbrRqFCP+Zk7EHMACKg8DpIw==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.10.2.tgz",
"integrity": "sha512-GalixiM9sckYfompH5HHTp9XT2BcjawBkcl1DMEKUBEi37+kUq0bivOBmnN1G/I4/wWOUdnAI/kagDWaWpbZPg==",
"requires": {
"@sentry/hub": "5.8.0",
"@sentry/types": "5.7.1",
"@sentry/hub": "5.10.2",
"@sentry/types": "5.10.0",
"tslib": "^1.9.3"
}
},
"@sentry/react-native": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-1.0.9.tgz",
"integrity": "sha512-fe1KEUJc+N4vq/k0ykqQ3el/CXxwTN7E8kBTYBCvxt9U449FdRodyFduiwz1UrkYhBsaQDC+5vQSZBZyT8EuOA==",
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@sentry/react-native/-/react-native-1.2.1.tgz",
"integrity": "sha512-JE2B/pMvd7+3TFdzs03+DOdrALAHd8bAphJ8tk+nWjX7oQVJNgVn/IvnJfKxasHHBXQ2z+42Xy9n2Fqam/Gq0w==",
"requires": {
"@sentry/browser": "^5.6.3",
"@sentry/core": "^5.6.2",
"@sentry/integrations": "^5.6.1",
"@sentry/types": "^5.6.1",
"@sentry/utils": "^5.6.1",
"@sentry/wizard": "^1.0.0"
"@sentry/browser": "^5.10.0",
"@sentry/core": "^5.10.0",
"@sentry/integrations": "^5.10.0",
"@sentry/types": "^5.10.0",
"@sentry/utils": "^5.10.0",
"@sentry/wizard": "^1.0.2"
}
},
"@sentry/types": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.7.1.tgz",
"integrity": "sha512-tbUnTYlSliXvnou5D4C8Zr+7/wJrHLbpYX1YkLXuIJRU0NSi81bHMroAuHWILcQKWhVjaV/HZzr7Y/hhWtbXVQ=="
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.10.0.tgz",
"integrity": "sha512-TW20GzkCWsP6uAxR2JIpIkiitCKyIOfkyDsKBeLqYj4SaZjfvBPnzgNCcYR0L0UsP1/Es6oHooZfIGSkp6GGxQ=="
},
"@sentry/utils": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.8.0.tgz",
"integrity": "sha512-KDxUvBSYi0/dHMdunbxAxD3389pcQioLtcO6CI6zt/nJXeVFolix66cRraeQvqupdLhvOk/el649W4fCPayTHw==",
"version": "5.10.2",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.10.2.tgz",
"integrity": "sha512-UcbbaFpYrGSV448lQ16Cr+W/MPuKUflQQUdrMCt5vgaf5+M7kpozlcji4GGGZUCXIA7oRP93ABoXj55s1OM9zw==",
"requires": {
"@sentry/types": "5.7.1",
"@sentry/types": "5.10.0",
"tslib": "^1.9.3"
}
},
@ -11068,9 +11068,9 @@
}
},
"react-native-quick-actions": {
"version": "0.3.12",
"resolved": "https://registry.npmjs.org/react-native-quick-actions/-/react-native-quick-actions-0.3.12.tgz",
"integrity": "sha512-jQkzbA6L1/+FIqvHnPenHUe2IrBihh48KOMTOa0QbOaxWzsejSB8kkWpSQOjYxjGu7k+3DVgosQ8wGJTB/l4JA=="
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/react-native-quick-actions/-/react-native-quick-actions-0.3.13.tgz",
"integrity": "sha512-Vz13a0+NV0mzCh/29tNt0qDzWPh8i2srTQW8eCSzGFDArnVm1COTOhTD0FY0hWHlxRY0ahvX+BlezTDvsyAuMA=="
},
"react-native-randombytes": {
"version": "3.5.3",
@ -11283,9 +11283,9 @@
}
},
"react-native-watch-connectivity": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.1.tgz",
"integrity": "sha512-fMx3hRXinxAoC64YUL+UkXuwlgYeYp3ECKMucxFgRtouzfCC3RGD+wewY7vxgOrcjkKXusIbCdbU4gS2Lojhqw=="
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/react-native-watch-connectivity/-/react-native-watch-connectivity-0.4.2.tgz",
"integrity": "sha512-es/c1yPRc5aQXNjKuNr0nCgYvuD126bGDRAhq5OaKpnccWHGQorctqxKYRKyNjloOM/NGc97C7DDNnfF1cCfJw=="
},
"react-native-webview": {
"version": "6.9.0",

10
package.json

@ -53,10 +53,10 @@
"dependencies": {
"@babel/preset-env": "7.5.0",
"@react-native-community/async-storage": "1.6.2",
"@react-native-community/blur": "3.3.1",
"@react-native-community/slider": "2.0.0-rc.1",
"@react-native-community/blur": "3.4.1",
"@react-native-community/slider": "2.0.8",
"@remobile/react-native-qrcode-local-image": "git+https://github.com/BlueWallet/react-native-qrcode-local-image.git",
"@sentry/react-native": "1.0.9",
"@sentry/react-native": "1.2.1",
"amplitude-js": "5.6.0",
"bech32": "1.1.3",
"bignumber.js": "9.0.0",
@ -108,7 +108,7 @@
"react-native-privacy-snapshot": "git+https://github.com/BlueWallet/react-native-privacy-snapshot.git",
"react-native-prompt-android": "git+https://github.com/marcosrdz/react-native-prompt-android.git",
"react-native-qrcode-svg": "5.1.2",
"react-native-quick-actions": "0.3.12",
"react-native-quick-actions": "0.3.13",
"react-native-randombytes": "3.5.3",
"react-native-rate": "1.1.7",
"react-native-secure-key-store": "git+https://github.com/marcosrdz/react-native-secure-key-store.git#38332f629f577cdd57c69fc8cc971b3cbad193c9",
@ -120,7 +120,7 @@
"react-native-tcp": "git+https://github.com/aprock/react-native-tcp.git",
"react-native-tooltip": "git+https://github.com/marcosrdz/react-native-tooltip.git",
"react-native-vector-icons": "6.6.0",
"react-native-watch-connectivity": "0.4.1",
"react-native-watch-connectivity": "0.4.2",
"react-native-webview": "6.9.0",
"react-navigation": "3.11.0",
"react-navigation-hooks": "1.1.0",

116
screen/wallets/selectWallet.js

@ -1,51 +1,35 @@
import React, { Component } from 'react';
/* eslint-disable react/prop-types */
import React, { useEffect, useState } from 'react';
import { View, ActivityIndicator, Image, Text, TouchableOpacity, FlatList } from 'react-native';
import { SafeBlueArea, BlueNavigationStyle, BlueText, BlueSpacing20, BluePrivateBalance } from '../../BlueComponents';
import LinearGradient from 'react-native-linear-gradient';
import PropTypes from 'prop-types';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/walletGradient';
import { useNavigationParam } from 'react-navigation-hooks';
import { Chain } from '../../models/bitcoinUnits';
/** @type {AppStorage} */
let BlueApp = require('../../BlueApp');
let loc = require('../../loc');
const BlueApp = require('../../BlueApp');
const loc = require('../../loc');
export default class SelectWallet extends Component {
static navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true, navigation.getParam('dismissAcion')),
title: loc.wallets.select_wallet,
});
constructor(props) {
super(props);
props.navigation.setParams({ dismissAcion: this.dismissComponent });
this.state = {
isLoading: true,
data: [],
};
this.chainType = props.navigation.getParam('chainType');
}
dismissComponent = () => {
this.props.navigation.goBack(null);
};
const SelectWallet = () => {
const chainType = useNavigationParam('chainType') || Chain.ONCHAIN;
const onWalletSelect = useNavigationParam('onWalletSelect');
const [isLoading, setIsLoading] = useState(true);
const data = chainType
? BlueApp.getWallets().filter(item => item.chain === chainType && item.allowSend())
: BlueApp.getWallets().filter(item => item.allowSend()) || [];
componentDidMount() {
const wallets = this.chainType
? BlueApp.getWallets().filter(item => item.chain === this.chainType && item.allowSend())
: BlueApp.getWallets().filter(item => item.allowSend());
this.setState({
data: wallets,
isLoading: false,
});
}
useEffect(() => {
setIsLoading(false);
});
_renderItem = ({ item }) => {
const renderItem = ({ item }) => {
return (
<TouchableOpacity
onPress={() => {
ReactNativeHapticFeedback.trigger('selection', { ignoreAndroidSystemSettings: false });
this.props.navigation.getParam('onWalletSelect')(item);
onWalletSelect(item);
}}
>
<View
@ -132,46 +116,36 @@ export default class SelectWallet extends Component {
);
};
render() {
if (this.state.isLoading) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignContent: 'center', paddingTop: 20 }}>
<ActivityIndicator />
if (isLoading) {
return (
<View style={{ flex: 1, justifyContent: 'center', alignContent: 'center', paddingTop: 20 }}>
<ActivityIndicator />
</View>
);
} else if (data.length <= 0) {
return (
<SafeBlueArea style={{ flex: 1 }}>
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', paddingTop: 20 }}>
<BlueText style={{ textAlign: 'center' }}>There are currently no Bitcoin wallets available.</BlueText>
<BlueSpacing20 />
<BlueText style={{ textAlign: 'center' }}>
A Bitcoin wallet is required to refill Lightning wallets. Please, create or import one.
</BlueText>
</View>
);
} else if (this.state.data.length <= 0) {
return (
<SafeBlueArea style={{ flex: 1 }}>
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', paddingTop: 20 }}>
<BlueText style={{ textAlign: 'center' }}>There are currently no Bitcoin wallets available.</BlueText>
<BlueSpacing20 />
<BlueText style={{ textAlign: 'center' }}>
A Bitcoin wallet is required to refill Lightning wallets. Please, create or import one.
</BlueText>
</View>
</SafeBlueArea>
);
}
</SafeBlueArea>
);
} else {
return (
<SafeBlueArea>
<FlatList
style={{ flex: 1 }}
extraData={this.state.data}
data={this.state.data}
renderItem={this._renderItem}
keyExtractor={(_item, index) => `${index}`}
/>
<SafeBlueArea style={{ flex: 1 }}>
<FlatList extraData={data} data={data} renderItem={renderItem} keyExtractor={(_item, index) => `${index}`} />
</SafeBlueArea>
);
}
}
SelectWallet.propTypes = {
navigation: PropTypes.shape({
navigate: PropTypes.func,
goBack: PropTypes.func,
setParams: PropTypes.func,
getParam: PropTypes.func,
}),
};
SelectWallet.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true, () => navigation.goBack(null)),
title: loc.wallets.select_wallet,
});
export default SelectWallet;

Loading…
Cancel
Save