2020-05-24 12:27:08 +02:00
|
|
|
import { LegacyWallet } from './wallets/legacy-wallet';
|
|
|
|
import { HDSegwitP2SHWallet } from './wallets/hd-segwit-p2sh-wallet';
|
2023-11-05 21:16:49 +01:00
|
|
|
import { LightningCustodianWallet } from './wallets/lightning-custodian-wallet'; // Missing import
|
2020-05-24 12:27:08 +02:00
|
|
|
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';
|
|
|
|
import { SLIP39LegacyP2PKHWallet, SLIP39SegwitP2SHWallet, SLIP39SegwitBech32Wallet } from './wallets/slip39-wallets';
|
2023-10-24 03:28:44 +02:00
|
|
|
import { useTheme } from '../components/themes';
|
2019-01-25 05:46:03 +01:00
|
|
|
|
|
|
|
export default class WalletGradient {
|
2023-11-05 21:16:49 +01:00
|
|
|
static hdSegwitP2SHWallet: string[] = ['#007AFF', '#0040FF'];
|
|
|
|
static hdSegwitBech32Wallet: string[] = ['#6CD9FC', '#44BEE5'];
|
|
|
|
static segwitBech32Wallet: string[] = ['#6CD9FC', '#44BEE5'];
|
|
|
|
static watchOnlyWallet: string[] = ['#474646', '#282828'];
|
|
|
|
static legacyWallet: string[] = ['#37E8C0', '#15BE98'];
|
|
|
|
static hdLegacyP2PKHWallet: string[] = ['#FD7478', '#E73B40'];
|
|
|
|
static hdLegacyBreadWallet: string[] = ['#fe6381', '#f99c42'];
|
|
|
|
static multisigHdWallet: string[] = ['#1ce6eb', '#296fc5', '#3500A2'];
|
|
|
|
static defaultGradients: string[] = ['#B770F6', '#9013FE'];
|
|
|
|
static lightningCustodianWallet: string[] = ['#F1AA07', '#FD7E37']; // Corrected property with missing colors
|
|
|
|
static aezeedWallet: string[] = ['#8584FF', '#5351FB'];
|
2020-10-08 22:03:57 +02:00
|
|
|
|
|
|
|
static createWallet = () => {
|
|
|
|
const { colors } = useTheme();
|
|
|
|
return colors.lightButton;
|
|
|
|
};
|
2019-01-25 05:46:03 +01:00
|
|
|
|
2023-11-05 21:16:49 +01:00
|
|
|
static gradientsFor(type: string): string[] {
|
|
|
|
let gradient: string[];
|
2019-01-25 05:46:03 +01:00
|
|
|
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;
|
2021-01-28 13:54:23 +01:00
|
|
|
case HDAezeedWallet.type:
|
|
|
|
gradient = WalletGradient.aezeedWallet;
|
|
|
|
break;
|
2023-11-05 21:16:49 +01:00
|
|
|
case LightningCustodianWallet.type:
|
|
|
|
gradient = WalletGradient.lightningCustodianWallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
default:
|
|
|
|
gradient = WalletGradient.defaultGradients;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return gradient;
|
|
|
|
}
|
|
|
|
|
2023-11-05 21:16:49 +01:00
|
|
|
static linearGradientProps(type: string) {
|
|
|
|
let props: any;
|
2020-12-11 18:35:47 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2023-11-05 21:16:49 +01:00
|
|
|
static headerColorFor(type: string): string {
|
|
|
|
let gradient: string[];
|
2019-01-25 05:46:03 +01:00
|
|
|
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;
|
2021-01-28 13:54:23 +01:00
|
|
|
case HDAezeedWallet.type:
|
|
|
|
gradient = WalletGradient.aezeedWallet;
|
|
|
|
break;
|
2023-11-05 21:16:49 +01:00
|
|
|
case LightningCustodianWallet.type:
|
|
|
|
gradient = WalletGradient.lightningCustodianWallet;
|
|
|
|
break;
|
2019-01-25 05:46:03 +01:00
|
|
|
default:
|
|
|
|
gradient = WalletGradient.defaultGradients;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return gradient[0];
|
|
|
|
}
|
|
|
|
}
|