2020-05-24 12:27:08 +02:00
|
|
|
import { LegacyWallet } from './wallets/legacy-wallet';
|
|
|
|
import { HDSegwitP2SHWallet } from './wallets/hd-segwit-p2sh-wallet';
|
|
|
|
import { LightningCustodianWallet } from './wallets/lightning-custodian-wallet';
|
|
|
|
import { HDLegacyBreadwalletWallet } from './wallets/hd-legacy-breadwallet-wallet';
|
|
|
|
import { HDLegacyP2PKHWallet } from './wallets/hd-legacy-p2pkh-wallet';
|
|
|
|
import { WatchOnlyWallet } from './wallets/watch-only-wallet';
|
|
|
|
import { HDSegwitBech32Wallet } from './wallets/hd-segwit-bech32-wallet';
|
|
|
|
import { SegwitBech32Wallet } from './wallets/segwit-bech32-wallet';
|
|
|
|
import { HDLegacyElectrumSeedP2PKHWallet } from './wallets/hd-legacy-electrum-seed-p2pkh-wallet';
|
|
|
|
import { HDSegwitElectrumSeedP2WPKHWallet } from './wallets/hd-segwit-electrum-seed-p2wpkh-wallet';
|
2020-10-05 23:25:14 +02:00
|
|
|
import { MultisigHDWallet } from './wallets/multisig-hd-wallet';
|
2021-04-15 19:52:48 +02:00
|
|
|
import { HDAezeedWallet } from './wallets/hd-aezeed-wallet';
|
2021-09-09 13:00:11 +02:00
|
|
|
import { LightningLdkWallet } from './wallets/lightning-ldk-wallet';
|
2021-04-15 19:52:48 +02:00
|
|
|
import { SLIP39LegacyP2PKHWallet, SLIP39SegwitP2SHWallet, SLIP39SegwitBech32Wallet } from './wallets/slip39-wallets';
|
2020-10-08 22:03:57 +02:00
|
|
|
import { useTheme } from '@react-navigation/native';
|
2019-01-25 05:46:03 +01:00
|
|
|
|
|
|
|
export default class WalletGradient {
|
2021-03-12 15:39:40 +01:00
|
|
|
static hdSegwitP2SHWallet = ['#007AFF', '#0040FF'];
|
2021-03-15 11:56:35 +01:00
|
|
|
static hdSegwitBech32Wallet = ['#6CD9FC', '#44BEE5'];
|
|
|
|
static segwitBech32Wallet = ['#6CD9FC', '#44BEE5'];
|
2021-03-12 15:39:40 +01:00
|
|
|
static watchOnlyWallet = ['#474646', '#282828'];
|
|
|
|
static legacyWallet = ['#37E8C0', '#15BE98'];
|
|
|
|
static hdLegacyP2PKHWallet = ['#FD7478', '#E73B40'];
|
2019-01-25 05:46:03 +01:00
|
|
|
static hdLegacyBreadWallet = ['#fe6381', '#f99c42'];
|
2020-10-05 23:25:14 +02:00
|
|
|
static multisigHdWallet = ['#1ce6eb', '#296fc5', '#3500A2'];
|
2021-03-12 15:39:40 +01:00
|
|
|
static defaultGradients = ['#B770F6', '#9013FE'];
|
|
|
|
static lightningCustodianWallet = ['#F1AA07', '#FD7E37'];
|
|
|
|
static aezeedWallet = ['#8584FF', '#5351FB'];
|
2021-09-09 13:00:11 +02:00
|
|
|
static ldkWallet = ['#8584FF', '#5351FB'];
|
2020-10-08 22:03:57 +02:00
|
|
|
|
|
|
|
static createWallet = () => {
|
|
|
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
|
|
const { colors } = useTheme();
|
|
|
|
return colors.lightButton;
|
|
|
|
};
|
2019-01-25 05:46:03 +01:00
|
|
|
|
|
|
|
static gradientsFor(type) {
|
|
|
|
let gradient;
|
|
|
|
switch (type) {
|
|
|
|
case WatchOnlyWallet.type:
|
|
|
|
gradient = WalletGradient.watchOnlyWallet;
|
|
|
|
break;
|
|
|
|
case LegacyWallet.type:
|
|
|
|
gradient = WalletGradient.legacyWallet;
|
|
|
|
break;
|
|
|
|
case HDLegacyP2PKHWallet.type:
|
2020-05-04 11:52:01 +02:00
|
|
|
case HDLegacyElectrumSeedP2PKHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39LegacyP2PKHWallet.type:
|
2019-01-25 05:46:03 +01:00
|
|
|
gradient = WalletGradient.hdLegacyP2PKHWallet;
|
|
|
|
break;
|
|
|
|
case HDLegacyBreadwalletWallet.type:
|
|
|
|
gradient = WalletGradient.hdLegacyBreadWallet;
|
|
|
|
break;
|
|
|
|
case HDSegwitP2SHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39SegwitP2SHWallet.type:
|
2019-01-25 05:46:03 +01:00
|
|
|
gradient = WalletGradient.hdSegwitP2SHWallet;
|
|
|
|
break;
|
2019-06-01 22:44:39 +02:00
|
|
|
case HDSegwitBech32Wallet.type:
|
2020-05-04 11:52:01 +02:00
|
|
|
case HDSegwitElectrumSeedP2WPKHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39SegwitBech32Wallet.type:
|
2019-06-01 22:44:39 +02:00
|
|
|
gradient = WalletGradient.hdSegwitBech32Wallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
case LightningCustodianWallet.type:
|
|
|
|
gradient = WalletGradient.lightningCustodianWallet;
|
|
|
|
break;
|
2020-03-31 18:49:30 +02:00
|
|
|
case SegwitBech32Wallet.type:
|
|
|
|
gradient = WalletGradient.segwitBech32Wallet;
|
|
|
|
break;
|
2020-10-05 23:25:14 +02:00
|
|
|
case MultisigHDWallet.type:
|
|
|
|
gradient = WalletGradient.multisigHdWallet;
|
|
|
|
break;
|
2021-01-28 13:54:23 +01:00
|
|
|
case HDAezeedWallet.type:
|
|
|
|
gradient = WalletGradient.aezeedWallet;
|
|
|
|
break;
|
2021-09-09 13:00:11 +02:00
|
|
|
case LightningLdkWallet.type:
|
|
|
|
gradient = WalletGradient.ldkWallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
default:
|
|
|
|
gradient = WalletGradient.defaultGradients;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return gradient;
|
|
|
|
}
|
|
|
|
|
2020-12-11 18:35:47 +01:00
|
|
|
static linearGradientProps(type) {
|
|
|
|
let props;
|
|
|
|
switch (type) {
|
|
|
|
case MultisigHDWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
/* Example
|
2020-12-11 18:35:47 +01:00
|
|
|
props = { start: { x: 0, y: 0 } };
|
|
|
|
https://github.com/react-native-linear-gradient/react-native-linear-gradient
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
|
2019-01-25 05:46:03 +01:00
|
|
|
static headerColorFor(type) {
|
|
|
|
let gradient;
|
|
|
|
switch (type) {
|
|
|
|
case WatchOnlyWallet.type:
|
|
|
|
gradient = WalletGradient.watchOnlyWallet;
|
|
|
|
break;
|
|
|
|
case LegacyWallet.type:
|
|
|
|
gradient = WalletGradient.legacyWallet;
|
|
|
|
break;
|
|
|
|
case HDLegacyP2PKHWallet.type:
|
2020-05-04 11:52:01 +02:00
|
|
|
case HDLegacyElectrumSeedP2PKHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39LegacyP2PKHWallet.type:
|
2019-01-25 05:46:03 +01:00
|
|
|
gradient = WalletGradient.hdLegacyP2PKHWallet;
|
|
|
|
break;
|
|
|
|
case HDLegacyBreadwalletWallet.type:
|
|
|
|
gradient = WalletGradient.hdLegacyBreadWallet;
|
|
|
|
break;
|
|
|
|
case HDSegwitP2SHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39SegwitP2SHWallet.type:
|
2019-01-25 05:46:03 +01:00
|
|
|
gradient = WalletGradient.hdSegwitP2SHWallet;
|
|
|
|
break;
|
2019-06-01 22:44:39 +02:00
|
|
|
case HDSegwitBech32Wallet.type:
|
2020-05-04 11:52:01 +02:00
|
|
|
case HDSegwitElectrumSeedP2WPKHWallet.type:
|
2021-04-15 19:52:48 +02:00
|
|
|
case SLIP39SegwitBech32Wallet.type:
|
2019-06-01 22:44:39 +02:00
|
|
|
gradient = WalletGradient.hdSegwitBech32Wallet;
|
|
|
|
break;
|
2020-03-31 18:49:30 +02:00
|
|
|
case SegwitBech32Wallet.type:
|
|
|
|
gradient = WalletGradient.segwitBech32Wallet;
|
|
|
|
break;
|
2020-10-05 23:25:14 +02:00
|
|
|
case MultisigHDWallet.type:
|
|
|
|
gradient = WalletGradient.multisigHdWallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
case LightningCustodianWallet.type:
|
|
|
|
gradient = WalletGradient.lightningCustodianWallet;
|
|
|
|
break;
|
2021-01-28 13:54:23 +01:00
|
|
|
case HDAezeedWallet.type:
|
|
|
|
gradient = WalletGradient.aezeedWallet;
|
|
|
|
break;
|
2021-09-09 13:00:11 +02:00
|
|
|
case LightningLdkWallet.type:
|
|
|
|
gradient = WalletGradient.ldkWallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
default:
|
|
|
|
gradient = WalletGradient.defaultGradients;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return gradient[0];
|
|
|
|
}
|
|
|
|
}
|