Moved "wallets" to subfolder and updated files in "class" folder to be kabob-case.

This commit is contained in:
Matt Gurzenski 2020-05-24 06:27:08 -04:00
parent 81b62e3817
commit 095012af30
36 changed files with 64 additions and 60 deletions

2
App.js
View File

@ -9,7 +9,7 @@ import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Chain } from './models/bitcoinUnits'; import { Chain } from './models/bitcoinUnits';
import QuickActions from 'react-native-quick-actions'; import QuickActions from 'react-native-quick-actions';
import * as Sentry from '@sentry/react-native'; import * as Sentry from '@sentry/react-native';
import OnAppLaunch from './class/onAppLaunch'; import OnAppLaunch from './class/on-app-launch';
import DeeplinkSchemaMatch from './class/deeplink-schema-match'; import DeeplinkSchemaMatch from './class/deeplink-schema-match';
import BitcoinBIP70TransactionDecode from './bip70/bip70'; import BitcoinBIP70TransactionDecode from './bip70/bip70';
const A = require('./analytics'); const A = require('./analytics');

View File

@ -2,7 +2,7 @@
* @exports {AppStorage} * @exports {AppStorage}
*/ */
import { AppStorage } from './class'; import { AppStorage } from './class';
import DeviceQuickActions from './class/quickActions'; import DeviceQuickActions from './class/quick-actions';
let prompt = require('./prompt'); let prompt = require('./prompt');
let EV = require('./events'); let EV = require('./events');
let currency = require('./currency'); let currency = require('./currency');

View File

@ -28,7 +28,7 @@ import { LightningCustodianWallet, PlaceholderWallet } from './class';
import Carousel from 'react-native-snap-carousel'; import Carousel from 'react-native-snap-carousel';
import { BitcoinUnit } from './models/bitcoinUnits'; import { BitcoinUnit } from './models/bitcoinUnits';
import NavigationService from './NavigationService'; import NavigationService from './NavigationService';
import WalletGradient from './class/walletGradient'; import WalletGradient from './class/wallet-gradient';
import ToolTip from 'react-native-tooltip'; import ToolTip from 'react-native-tooltip';
import { BlurView } from '@react-native-community/blur'; import { BlurView } from '@react-native-community/blur';
import showPopupMenu from 'react-native-popup-menu-android'; import showPopupMenu from 'react-native-popup-menu-android';

View File

@ -15,7 +15,7 @@ import {
HDSegwitElectrumSeedP2WPKHWallet, HDSegwitElectrumSeedP2WPKHWallet,
} from './'; } from './';
import WatchConnectivity from '../WatchConnectivity'; import WatchConnectivity from '../WatchConnectivity';
import DeviceQuickActions from './quickActions'; import DeviceQuickActions from './quick-actions';
const encryption = require('../encryption'); const encryption = require('../encryption');
export class AppStorage { export class AppStorage {

View File

@ -1,17 +1,17 @@
export * from './abstract-wallet'; export * from './wallets/abstract-wallet';
export * from './app-storage'; export * from './app-storage';
export * from './constants'; export * from './constants';
export * from './legacy-wallet'; export * from './wallets/legacy-wallet';
export * from './segwit-bech32-wallet'; export * from './wallets/segwit-bech32-wallet';
export * from './segwit-p2sh-wallet'; export * from './wallets/segwit-p2sh-wallet';
export * from './hd-segwit-p2sh-wallet'; export * from './wallets/hd-segwit-p2sh-wallet';
export * from './hd-legacy-breadwallet-wallet'; export * from './wallets/hd-legacy-breadwallet-wallet';
export * from './hd-legacy-p2pkh-wallet'; export * from './wallets/hd-legacy-p2pkh-wallet';
export * from './watch-only-wallet'; export * from './wallets/watch-only-wallet';
export * from './lightning-custodian-wallet'; export * from './wallets/lightning-custodian-wallet';
export * from './abstract-hd-wallet'; export * from './wallets/abstract-hd-wallet';
export * from './hd-segwit-bech32-wallet'; export * from './wallets/hd-segwit-bech32-wallet';
export * from './hd-segwit-bech32-transaction'; export * from './hd-segwit-bech32-transaction';
export * from './placeholder-wallet'; export * from './wallets/placeholder-wallet';
export * from './hd-legacy-electrum-seed-p2pkh-wallet'; export * from './wallets/hd-legacy-electrum-seed-p2pkh-wallet';
export * from './hd-segwit-electrum-seed-p2wpkh-wallet'; export * from './wallets/hd-segwit-electrum-seed-p2wpkh-wallet';

View File

@ -20,7 +20,7 @@ export default class DeviceQuickActions {
QuickActions.isSupported((error, _supported) => { QuickActions.isSupported((error, _supported) => {
if (error === null) { if (error === null) {
let shortcutItems = []; let shortcutItems = [];
const loc = require('../loc/'); const loc = require('../loc');
for (const wallet of DeviceQuickActions.shared.wallets) { for (const wallet of DeviceQuickActions.shared.wallets) {
shortcutItems.push({ shortcutItems.push({
type: 'Wallets', // Required type: 'Wallets', // Required

View File

@ -1,14 +1,14 @@
import { LegacyWallet } from './legacy-wallet'; import { LegacyWallet } from './wallets/legacy-wallet';
import { HDSegwitP2SHWallet } from './hd-segwit-p2sh-wallet'; import { HDSegwitP2SHWallet } from './wallets/hd-segwit-p2sh-wallet';
import { LightningCustodianWallet } from './lightning-custodian-wallet'; import { LightningCustodianWallet } from './wallets/lightning-custodian-wallet';
import { HDLegacyBreadwalletWallet } from './hd-legacy-breadwallet-wallet'; import { HDLegacyBreadwalletWallet } from './wallets/hd-legacy-breadwallet-wallet';
import { HDLegacyP2PKHWallet } from './hd-legacy-p2pkh-wallet'; import { HDLegacyP2PKHWallet } from './wallets/hd-legacy-p2pkh-wallet';
import { WatchOnlyWallet } from './watch-only-wallet'; import { WatchOnlyWallet } from './wallets/watch-only-wallet';
import { HDSegwitBech32Wallet } from './hd-segwit-bech32-wallet'; import { HDSegwitBech32Wallet } from './wallets/hd-segwit-bech32-wallet';
import { PlaceholderWallet } from './placeholder-wallet'; import { PlaceholderWallet } from './wallets/placeholder-wallet';
import { SegwitBech32Wallet } from './segwit-bech32-wallet'; import { SegwitBech32Wallet } from './wallets/segwit-bech32-wallet';
import { HDLegacyElectrumSeedP2PKHWallet } from './hd-legacy-electrum-seed-p2pkh-wallet'; import { HDLegacyElectrumSeedP2PKHWallet } from './wallets/hd-legacy-electrum-seed-p2pkh-wallet';
import { HDSegwitElectrumSeedP2WPKHWallet } from './hd-segwit-electrum-seed-p2wpkh-wallet'; import { HDSegwitElectrumSeedP2WPKHWallet } from './wallets/hd-segwit-electrum-seed-p2wpkh-wallet';
export default class WalletGradient { export default class WalletGradient {
static hdSegwitP2SHWallet = ['#65ceef', '#68bbe1']; static hdSegwitP2SHWallet = ['#65ceef', '#68bbe1'];

View File

@ -12,7 +12,7 @@ import {
SegwitBech32Wallet, SegwitBech32Wallet,
HDLegacyElectrumSeedP2PKHWallet, HDLegacyElectrumSeedP2PKHWallet,
HDSegwitElectrumSeedP2WPKHWallet, HDSegwitElectrumSeedP2WPKHWallet,
} from '../class'; } from '.';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
const EV = require('../events'); const EV = require('../events');
const A = require('../analytics'); const A = require('../analytics');

View File

@ -1,10 +1,10 @@
import bip39 from 'bip39'; import bip39 from 'bip39';
import BigNumber from 'bignumber.js'; import BigNumber from 'bignumber.js';
import b58 from 'bs58check'; import b58 from 'bs58check';
import { randomBytes } from './rng'; import { randomBytes } from '../rng';
import { AbstractHDWallet } from './abstract-hd-wallet'; import { AbstractHDWallet } from './abstract-hd-wallet';
const bitcoin = require('bitcoinjs-lib'); const bitcoin = require('bitcoinjs-lib');
const BlueElectrum = require('../BlueElectrum'); const BlueElectrum = require('../../BlueElectrum');
const HDNode = require('bip32'); const HDNode = require('bip32');
const coinSelectAccumulative = require('coinselect/accumulative'); const coinSelectAccumulative = require('coinselect/accumulative');
const coinSelectSplit = require('coinselect/split'); const coinSelectSplit = require('coinselect/split');

View File

@ -1,7 +1,7 @@
import { LegacyWallet } from './legacy-wallet'; import { LegacyWallet } from './legacy-wallet';
import Frisbee from 'frisbee'; import Frisbee from 'frisbee';
const bip39 = require('bip39'); const bip39 = require('bip39');
const BlueElectrum = require('../BlueElectrum'); const BlueElectrum = require('../../BlueElectrum');
/** /**
* @deprecated * @deprecated

View File

@ -1,4 +1,4 @@
import { BitcoinUnit, Chain } from '../models/bitcoinUnits'; import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
const createHash = require('create-hash'); const createHash = require('create-hash');
export class AbstractWallet { export class AbstractWallet {

View File

@ -1,4 +1,4 @@
import { HDLegacyP2PKHWallet } from './'; import { HDLegacyP2PKHWallet } from '..';
const bitcoin = require('bitcoinjs-lib'); const bitcoin = require('bitcoinjs-lib');
const mn = require('electrum-mnemonic'); const mn = require('electrum-mnemonic');

View File

@ -2,7 +2,7 @@ import bip39 from 'bip39';
import { AbstractHDElectrumWallet } from './abstract-hd-electrum-wallet'; import { AbstractHDElectrumWallet } from './abstract-hd-electrum-wallet';
const bitcoin = require('bitcoinjs-lib'); const bitcoin = require('bitcoinjs-lib');
const HDNode = require('bip32'); const HDNode = require('bip32');
const BlueElectrum = require('../BlueElectrum'); const BlueElectrum = require('../../BlueElectrum');
/** /**
* HD Wallet (BIP39). * HD Wallet (BIP39).

View File

@ -1,4 +1,4 @@
import { HDSegwitBech32Wallet } from './'; import { HDSegwitBech32Wallet } from '..';
const bitcoin = require('bitcoinjs-lib'); const bitcoin = require('bitcoinjs-lib');
const mn = require('electrum-mnemonic'); const mn = require('electrum-mnemonic');

View File

@ -1,8 +1,8 @@
import { randomBytes } from './rng'; import { randomBytes } from '../rng';
import { AbstractWallet } from './abstract-wallet'; import { AbstractWallet } from './abstract-wallet';
import { HDSegwitBech32Wallet } from './'; import { HDSegwitBech32Wallet } from '..';
const bitcoin = require('bitcoinjs-lib'); const bitcoin = require('bitcoinjs-lib');
const BlueElectrum = require('../BlueElectrum'); const BlueElectrum = require('../../BlueElectrum');
const coinSelectAccumulative = require('coinselect/accumulative'); const coinSelectAccumulative = require('coinselect/accumulative');
const coinSelectSplit = require('coinselect/split'); const coinSelectSplit = require('coinselect/split');

View File

@ -1,7 +1,7 @@
import { LegacyWallet } from './legacy-wallet'; import { LegacyWallet } from './legacy-wallet';
import Frisbee from 'frisbee'; import Frisbee from 'frisbee';
import bolt11 from 'bolt11'; import bolt11 from 'bolt11';
import { BitcoinUnit, Chain } from '../models/bitcoinUnits'; import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
export class LightningCustodianWallet extends LegacyWallet { export class LightningCustodianWallet extends LegacyWallet {
static type = 'lightningCustodianWallet'; static type = 'lightningCustodianWallet';

View File

@ -3,7 +3,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import { AppStorage } from './class'; import { AppStorage } from './class';
import { FiatUnit } from './models/fiatUnit'; import { FiatUnit } from './models/fiatUnit';
import DefaultPreference from 'react-native-default-preference'; import DefaultPreference from 'react-native-default-preference';
import DeviceQuickActions from './class/quickActions'; import DeviceQuickActions from './class/quick-actions';
let BigNumber = require('bignumber.js'); let BigNumber = require('bignumber.js');
let preferredFiatCurrency = FiatUnit.USD; let preferredFiatCurrency = FiatUnit.USD;
let exchangeRates = {}; let exchangeRates = {};

View File

@ -17,7 +17,7 @@ import {
BlueDismissKeyboardInputAccessory, BlueDismissKeyboardInputAccessory,
BlueAlertWalletExportReminder, BlueAlertWalletExportReminder,
} from '../../BlueComponents'; } from '../../BlueComponents';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import bech32 from 'bech32'; import bech32 from 'bech32';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits'; import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';

View File

@ -12,7 +12,7 @@ import {
BlueBitcoinAmount, BlueBitcoinAmount,
BlueLoading, BlueLoading,
} from '../../BlueComponents'; } from '../../BlueComponents';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits'; import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements'; import { Icon } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { TouchableOpacity, View, TouchableWithoutFeedback } from 'react-native'; import { TouchableOpacity, View, TouchableWithoutFeedback } from 'react-native';
import { SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueListItem } from '../../BlueComponents'; import { SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueListItem } from '../../BlueComponents';
import OnAppLaunch from '../../class/onAppLaunch'; import OnAppLaunch from '../../class/on-app-launch';
import { useNavigation } from 'react-navigation-hooks'; import { useNavigation } from 'react-navigation-hooks';
const BlueApp = require('../../BlueApp'); const BlueApp = require('../../BlueApp');

View File

@ -6,7 +6,7 @@ import AsyncStorage from '@react-native-community/async-storage';
import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents'; import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button } from 'react-native-elements'; import { Button } from 'react-native-elements';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
/** @type {AppStorage} */ /** @type {AppStorage} */
let BlueApp = require('../../BlueApp'); let BlueApp = require('../../BlueApp');
let loc = require('../../loc'); let loc = require('../../loc');

View File

@ -26,9 +26,13 @@ import {
BlueSpacing20, BlueSpacing20,
} from '../../BlueComponents'; } from '../../BlueComponents';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { HDSegwitP2SHWallet } from '../../class/hd-segwit-p2sh-wallet'; import {
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; HDSegwitBech32Wallet,
import { AppStorage, HDSegwitBech32Wallet, SegwitP2SHWallet } from '../../class'; SegwitP2SHWallet,
HDSegwitP2SHWallet,
LightningCustodianWallet
} from '../../class';
import { AppStorage } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements'; import { Icon } from 'react-native-elements';
let EV = require('../../events'); let EV = require('../../events');

View File

@ -16,10 +16,10 @@ import {
} from 'react-native'; } from 'react-native';
import { BlueButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle, BlueText } from '../../BlueComponents'; import { BlueButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import { HDLegacyBreadwalletWallet } from '../../class/hd-legacy-breadwallet-wallet'; import { HDLegacyBreadwalletWallet } from '../../class/wallets/hd-legacy-breadwallet-wallet';
import { HDLegacyP2PKHWallet } from '../../class/hd-legacy-p2pkh-wallet'; import { HDLegacyP2PKHWallet } from '../../class/wallets/hd-legacy-p2pkh-wallet';
import { HDSegwitP2SHWallet } from '../../class/hd-segwit-p2sh-wallet'; import { HDSegwitP2SHWallet } from '../../class/wallets/hd-segwit-p2sh-wallet';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics'; import Biometric from '../../class/biometrics';
import { HDSegwitBech32Wallet, SegwitP2SHWallet, LegacyWallet, SegwitBech32Wallet, WatchOnlyWallet } from '../../class'; import { HDSegwitBech32Wallet, SegwitP2SHWallet, LegacyWallet, SegwitBech32Wallet, WatchOnlyWallet } from '../../class';

View File

@ -14,7 +14,7 @@ import {
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Privacy from '../../Privacy'; import Privacy from '../../Privacy';
import { useNavigation, useNavigationParam } from 'react-navigation-hooks'; import { useNavigation, useNavigationParam } from 'react-navigation-hooks';
import WalletImport from '../../class/walletImport'; import WalletImport from '../../class/wallet-import';
let loc = require('../../loc'); let loc = require('../../loc');
const { width } = Dimensions.get('window'); const { width } = Dimensions.get('window');

View File

@ -6,7 +6,7 @@ import { NavigationEvents } from 'react-navigation';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { PlaceholderWallet } from '../../class'; import { PlaceholderWallet } from '../../class';
import WalletImport from '../../class/walletImport'; import WalletImport from '../../class/wallet-import';
import ViewPager from '@react-native-community/viewpager'; import ViewPager from '@react-native-community/viewpager';
import ScanQRCode from '../send/ScanQRCode'; import ScanQRCode from '../send/ScanQRCode';
import DeeplinkSchemaMatch from '../../class/deeplink-schema-match'; import DeeplinkSchemaMatch from '../../class/deeplink-schema-match';

View File

@ -6,7 +6,7 @@ import LinearGradient from 'react-native-linear-gradient';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { PlaceholderWallet, LightningCustodianWallet } from '../../class'; import { PlaceholderWallet, LightningCustodianWallet } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/walletGradient'; import WalletGradient from '../../class/wallet-gradient';
let EV = require('../../events'); let EV = require('../../events');
/** @type {AppStorage} */ /** @type {AppStorage} */
let BlueApp = require('../../BlueApp'); let BlueApp = require('../../BlueApp');

View File

@ -3,9 +3,9 @@ import React, { useEffect, useState } from 'react';
import { View, ActivityIndicator, Image, Text, TouchableOpacity, FlatList } from 'react-native'; import { View, ActivityIndicator, Image, Text, TouchableOpacity, FlatList } from 'react-native';
import { SafeBlueArea, BlueNavigationStyle, BlueText, BlueSpacing20, BluePrivateBalance } from '../../BlueComponents'; import { SafeBlueArea, BlueNavigationStyle, BlueText, BlueSpacing20, BluePrivateBalance } from '../../BlueComponents';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/walletGradient'; import WalletGradient from '../../class/wallet-gradient';
import { useNavigationParam } from 'react-navigation-hooks'; import { useNavigationParam } from 'react-navigation-hooks';
/** @type {AppStorage} */ /** @type {AppStorage} */
const BlueApp = require('../../BlueApp'); const BlueApp = require('../../BlueApp');

View File

@ -30,7 +30,7 @@ import {
BlueWalletNavigationHeader, BlueWalletNavigationHeader,
BlueAlertWalletExportReminder, BlueAlertWalletExportReminder,
} from '../../BlueComponents'; } from '../../BlueComponents';
import WalletGradient from '../../class/walletGradient'; import WalletGradient from '../../class/wallet-gradient';
import { Icon } from 'react-native-elements'; import { Icon } from 'react-native-elements';
import { LightningCustodianWallet, WatchOnlyWallet } from '../../class'; import { LightningCustodianWallet, WatchOnlyWallet } from '../../class';
import Modal from 'react-native-modal'; import Modal from 'react-native-modal';