diff --git a/Makefile b/Makefile
index eecddb7f1..6c9877609 100644
--- a/Makefile
+++ b/Makefile
@@ -31,4 +31,4 @@ fastlane-mainnet:
fastlane-regtest:
cd android && caffeinate -dimsu bundle exec fastlane release_android_regtest && cd .. && cd ios && caffeinate -dimsu bundle exec fastlane release_ios_regtest skip_prep:true
-
\ No newline at end of file
+
diff --git a/assets/i18n/en.i18n.yaml b/assets/i18n/en.i18n.yaml
index 5422d9e10..44d5074d0 100644
--- a/assets/i18n/en.i18n.yaml
+++ b/assets/i18n/en.i18n.yaml
@@ -99,6 +99,12 @@ block_explorer: "Block Explorer"
log_viewer: "Log Viewer"
go_to_settings: "Go to Settings"
+relative_time:
+ days_ago(cardinal):
+ zero: "Today" # 0일이면 Today로 처리(원하면 생략 가능)
+ one: "1 day ago" # 1일
+ other: "${n} days ago" # 2일 이상
+
apply_item: "$count items"
fee_sats: " ($value sat/vB)"
utxo_count: "($count items)"
@@ -187,6 +193,52 @@ pin_check_screen:
text: "Enter your password"
# lib/screens/home
+wallet_home_screen:
+ view_all_wallets: "View All My Wallets"
+ edit_home_screen: "Edit Home Screen"
+ edit:
+ title: "You can hide or add features\non the home screen"
+ hide_balance: "Hide Balance"
+ hide_balance_on_home: "Balance will not be displayed on the home screen."
+ fake_balance:
+ fake_balance_setting: "Set Fake Balance"
+ fake_balance_display: "Show Fake Balance"
+ fake_balance_input_placeholder: "Please set the total fake balance (in BTC units)"
+ fake_balance_input_description: "If you have multiple wallets, each wallet's balance will be calculated automatically."
+ fake_balance_input_exceeds_error: "You can set up to 21 million BTC"
+ hide_fiat_price: "Hide Fiat Balance"
+ hide_fiat_price_on_home: "Fiat balance will not be displayed on the home screen."
+ category:
+ total_balance: "Total\nBalance"
+ wallet_list: "Wallet\nList"
+ recent_transactions: "Recent\nTransactions (24 hours)"
+ analysis: "Analysis"
+ alert:
+ empty_fake_balance: "Enter Fake Balance"
+ empty_fake_balance_description: "No amount has been entered.\nWould you like to enter it again or set it to 0 BTC?"
+ set_to_0: "Set balance to 0 BTC"
+ enter_again: "Try again"
+ empty_recent_transaction: "No recent 24 hours transactions"
+ syncing_recent_transaction: "Syncing recent transactions"
+ empty_analysis_result: "No transactions needed for analysis"
+ analysis_period: "Recent ${days} days • ${transaction_type}"
+ analysis_period_custom: "Custom • ${transaction_type}"
+ analysis_period_bottom_sheet:
+ period_for_analysis: "Analysis Period"
+ days_15: "15 days"
+ days_30: "30 days"
+ days_60: "60 days"
+ days_90: "90 days"
+ custom: "Custom"
+ transaction_type: "Transaction Type"
+
+ transaction_count: "Transaction $count times"
+ count: "$count times"
+ increase: "Increased"
+ decrease: "Decreased"
+ sent: "Sent"
+ received: "Received"
+
wallet_add_scanner_screen:
add_wallet: "Add Wallet"
add_watch_only_wallet: "Add Watch-only Wallet"
@@ -254,7 +306,6 @@ wallet_add_scanner_screen:
# lib/screens/wallet_list
wallet_list:
wallet_count: "$count Items"
- view_all_wallets: "View All My Wallets"
primary_wallet: "Primary Wallet"
exclude_from_total_amount: "Excluded from Home Total"
home_balance: "Home Balance"
@@ -456,13 +507,6 @@ settings_screen:
set_password: "Set Password"
use_biometric: "Use Biometric Auth"
change_password: "Change Password"
- hide_balance: "Hide Balance"
- fake_balance:
- fake_balance_setting: "Set Fake Balance"
- fake_balance_display: "Show Fake Balance"
- fake_balance_input_placeholder: "Please set the total fake balance (in BTC units)"
- fake_balance_input_description: "If you have multiple wallets, each wallet's balance will be calculated automatically."
- fake_balance_input_exceeds_error: "You can set up to 21 million BTC"
language: "Language"
korean: "한국어"
english: "English"
diff --git a/assets/i18n/jp.i18n.yaml b/assets/i18n/jp.i18n.yaml
index a7d483be0..7066955ab 100644
--- a/assets/i18n/jp.i18n.yaml
+++ b/assets/i18n/jp.i18n.yaml
@@ -187,6 +187,52 @@ pin_check_screen:
text: "パスワードを入力してください"
# lib/screens/home
+wallet_home_screen:
+ view_all_wallets: "マイウォレット一覧"
+ edit_home_screen: "ホーム画面を編集"
+ edit:
+ title: "ホーム画面で機能を\n非表示にしたり、追加したりできます"
+ hide_balance: "残高を非表示"
+ hide_balance_on_home: "ホーム画面に残高を表示しません。"
+ fake_balance:
+ fake_balance_setting: "フェイク残高設定"
+ fake_balance_display: "フェイク残高表示"
+ fake_balance_input_placeholder: "偽の総残高を設定してください(BTC単位)"
+ fake_balance_input_description: "複数のウォレットがある場合、各ウォレットの残高は自動的に計算されます。"
+ fake_balance_input_exceeds_error: "最大2100万BTCまで設定できます。"
+ hide_fiat_price: "フィアット残高を非表示"
+ hide_fiat_price_on_home: "ホーム画面にフィアット残高を表示しません。"
+ category:
+ total_balance: "残高合計"
+ wallet_list: "ウォレット\n一覧"
+ recent_transactions: "最近の\n取引(24時間)"
+ analysis: "分析"
+ alert:
+ empty_fake_balance: "フェイク残高を入力"
+ empty_fake_balance_description: "金額が設定されていません。\nもう一度入力するか、0 BTCに設定しますか?"
+ set_to_0: "0 BTCに設定"
+ enter_again: "再入力"
+ empty_recent_transaction: "最近24時間の取引がありません"
+ syncing_recent_transaction: "最近の取引履歴を読み込んでいます"
+ empty_analysis_result: "分析に必要な取引はありません"
+ analysis_period: "直近${days}日 • ${transaction_type}"
+ analysis_period_cutsom: "直接設定 • ${transaction_type}"
+ analysis_period_bottom_sheet:
+ period_for_analysis: "照会期間"
+ days_15: "15日"
+ days_30: "30日"
+ days_60: "60日"
+ days_90: "90日"
+ custom: "直接設定"
+ transaction_type: "取引タイプ"
+
+ transaction_count: "取引 $count回"
+ count: "$count回"
+ increase: "増加しました"
+ decrease: "減少しました"
+ sent: "送りました"
+ received: "いただきました"
+
wallet_add_scanner_screen:
add_wallet: "ウォレット追加"
add_watch_only_wallet: "ウォッチオンリー\nウォレット追加"
@@ -457,12 +503,6 @@ settings_screen:
use_biometric: "生体認証を使用"
change_password: "パスワード変更"
hide_balance: "残高を非表示"
- fake_balance:
- fake_balance_setting: "偽残高設定"
- fake_balance_display: "偽残高を表示"
- fake_balance_input_placeholder: "偽の総残高を設定してください(BTC単位)"
- fake_balance_input_description: "複数のウォレットがある場合、各ウォレットの残高は自動的に計算されます。"
- fake_balance_input_exceeds_error: "最大2100万BTCまで設定できます"
language: "言語"
korean: "한국어"
english: "English"
diff --git a/assets/i18n/kr.i18n.yaml b/assets/i18n/kr.i18n.yaml
index 233539580..ed71c6d98 100644
--- a/assets/i18n/kr.i18n.yaml
+++ b/assets/i18n/kr.i18n.yaml
@@ -99,6 +99,12 @@ block_explorer: "블록 익스플로러"
log_viewer: "로그 뷰어"
go_to_settings: "설정하러 가기"
+relative_time:
+ days_ago(cardinal):
+ zero: "오늘" # 0일이면 Today로 처리(원하면 생략 가능)
+ one: "1일 전" # 1일
+ other: "${n}일 전" # 2일 이상
+
apply_item: "$count개에 적용"
fee_sats: " ($value sat/vB)"
utxo_count: "($count개)"
@@ -187,6 +193,52 @@ pin_check_screen:
text: "비밀번호를 눌러주세요"
# lib/screens/home
+wallet_home_screen:
+ view_all_wallets: "내 지갑 전체보기"
+ edit_home_screen: "홈 화면 편집하기"
+ edit:
+ title: "홈 화면에 기능을\n숨기거나 추가할 수 있어요"
+ hide_balance: "잔액 숨기기"
+ hide_balance_on_home: "홈 화면에 잔액을 표시하지 않아요."
+ fake_balance:
+ fake_balance_setting: "가짜 잔액 설정"
+ fake_balance_display: "가짜 잔액 표시"
+ fake_balance_input_placeholder: "총 가짜 잔액을 설정해 주세요.(BTC 단위)"
+ fake_balance_input_description: "여러 지갑이 있을 경우, 각 지갑의 잔액은 자동으로 계산돼요."
+ fake_balance_input_exceeds_error: "최대 2100만 BTC까지 설정할 수 있어요"
+ hide_fiat_price: "법정 화폐 잔액 숨기기"
+ hide_fiat_price_on_home: "홈 화면에 법정 화폐 잔액을 표시하지 않아요."
+ category:
+ total_balance: "잔액 합계"
+ wallet_list: "지갑 목록"
+ recent_transactions: "최근 거래\n(24시간)"
+ analysis: "분석"
+ alert:
+ empty_fake_balance: "가짜 잔액 입력"
+ empty_fake_balance_description: "금액이 설정되지 않았어요.\n다시 입력하시거나 0 BTC로 설정할까요?"
+ set_to_0: "0 BTC로 설정"
+ enter_again: "다시 입력"
+ empty_recent_transaction: "최근 24시간 동안의 거래가 없어요"
+ syncing_recent_transaction: "최근 거래 내역을 불러오는 중이에요"
+ empty_analysis_result: "분석에 필요한 거래가 없어요"
+ analysis_period: "최근 ${days}일 • ${transaction_type}"
+ analysis_period_cutsom: "직접 설정 • ${transaction_type}"
+ analysis_period_bottom_sheet:
+ period_for_analysis: "조회 기간"
+ days_15: "15일"
+ days_30: "30일"
+ days_60: "60일"
+ days_90: "90일"
+ custom: "직접 설정"
+ transaction_type: "거래 유형"
+
+ transaction_count: "트랜잭션 $count회"
+ count: "$count회"
+ increase: "증가했어요"
+ decrease: "감소했어요"
+ sent: "보냈어요"
+ received: "받았어요"
+
wallet_add_scanner_screen:
add_wallet: "지갑 추가"
add_watch_only_wallet: "보기 전용 지갑 추가"
@@ -254,7 +306,6 @@ wallet_add_scanner_screen:
# lib/screens/wallet_list
wallet_list:
wallet_count: "$count개"
- view_all_wallets: "내 지갑 전체보기"
primary_wallet: "대표 지갑"
exclude_from_total_amount: "홈 화면 총액에서 제외"
home_balance: "홈 화면 총액"
@@ -456,13 +507,6 @@ settings_screen:
set_password: "비밀번호 설정하기"
use_biometric: "생체 인증 사용하기"
change_password: "비밀번호 바꾸기"
- hide_balance: "홈 화면 잔액 숨기기"
- fake_balance:
- fake_balance_setting: "가짜 잔액 설정"
- fake_balance_display: "가짜 잔액 표시"
- fake_balance_input_placeholder: "총 가짜 잔액을 설정해 주세요.(BTC 단위)"
- fake_balance_input_description: "여러 지갑이 있을 경우, 각 지갑의 잔액은 자동으로 계산돼요."
- fake_balance_input_exceeds_error: "최대 2100만 BTC까지 설정할 수 있어요"
language: "언어"
korean: "한국어"
english: "English"
@@ -834,7 +878,7 @@ trade_exchange:
binance: "바이낸스"
fiat:
- fiat: "법정화폐"
+ fiat: "법정 화폐"
krw_price: "업비트 기준"
usd_price: "바이낸스 기준"
jpy_price: "비트플라이어 기준"
diff --git a/assets/svg/analysis.svg b/assets/svg/analysis.svg
new file mode 100644
index 000000000..2a5dccc9c
--- /dev/null
+++ b/assets/svg/analysis.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/svg/piggy-bank.svg b/assets/svg/piggy-bank.svg
new file mode 100644
index 000000000..1af68bb45
--- /dev/null
+++ b/assets/svg/piggy-bank.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/svg/transaction.svg b/assets/svg/transaction.svg
new file mode 100644
index 000000000..24665d54b
--- /dev/null
+++ b/assets/svg/transaction.svg
@@ -0,0 +1,9 @@
+
diff --git a/assets/svg/wallet.svg b/assets/svg/wallet.svg
new file mode 100644
index 000000000..f7062fd8e
--- /dev/null
+++ b/assets/svg/wallet.svg
@@ -0,0 +1,9 @@
+
diff --git a/lib/app.dart b/lib/app.dart
index 7c516803a..e0052874b 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -4,7 +4,8 @@ import 'package:coconut_wallet/app_guard.dart';
import 'package:coconut_wallet/providers/auth_provider.dart';
import 'package:coconut_wallet/providers/connectivity_provider.dart';
import 'package:coconut_wallet/providers/node_provider/node_provider.dart';
-import 'package:coconut_wallet/providers/preference_provider.dart';
+import 'package:coconut_wallet/providers/preferences/feature_settings_provider.dart';
+import 'package:coconut_wallet/providers/preferences/preference_provider.dart';
import 'package:coconut_wallet/providers/send_info_provider.dart';
import 'package:coconut_wallet/providers/transaction_provider.dart';
import 'package:coconut_wallet/providers/utxo_tag_provider.dart';
@@ -58,6 +59,7 @@ import 'package:flutter/material.dart';
import 'package:coconut_wallet/screens/common/pin_check_screen.dart';
import 'package:coconut_wallet/screens/onboarding/start_screen.dart';
import 'package:coconut_wallet/widgets/custom_loading_overlay.dart';
+import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'package:coconut_wallet/localization/strings.g.dart';
import 'package:coconut_wallet/services/analytics_service.dart';
@@ -98,6 +100,7 @@ class _CoconutWalletAppState extends State {
ChangeNotifierProvider(create: (_) => VisibilityProvider()),
ChangeNotifierProvider(create: (_) => ConnectivityProvider()),
ChangeNotifierProvider(create: (_) => AuthProvider()),
+ ChangeNotifierProvider(create: (_) => FeatureSettingsProvider()),
Provider.value(value: _realmManager),
@@ -119,9 +122,21 @@ class _CoconutWalletAppState extends State {
create: (context) => WalletPreferencesRepository(context.read()),
),
- ChangeNotifierProvider(create: (_) => PreferenceProvider(context.read())),
+ ChangeNotifierProvider(
+ create:
+ (context) => PreferenceProvider(
+ context.read(),
+ featureSettingsProvider: context.read(),
+ ),
+ ),
- ChangeNotifierProvider(create: (context) => PreferenceProvider(context.read())),
+ ChangeNotifierProvider(
+ create:
+ (context) => PreferenceProvider(
+ context.read(),
+ featureSettingsProvider: context.read(),
+ ),
+ ),
ChangeNotifierProvider(
create: (context) => PriceProvider(context.read(), context.read()),
diff --git a/lib/constants/shared_pref_keys.dart b/lib/constants/shared_pref_keys.dart
index e5d1b1e4e..55492f75e 100644
--- a/lib/constants/shared_pref_keys.dart
+++ b/lib/constants/shared_pref_keys.dart
@@ -19,10 +19,22 @@ class SharedPrefKeys {
static const String kIsReceivingTooltipDisabled = "IS_RECEIVING_TOOLTIP_DISABLED";
static const String kIsChangeTooltipDisabled = "IS_CHANGE_TOOLTIP_DISABLED";
static const String kIsBalanceHidden = "IS_BALANCE_HIDDEN";
+ static const String kIsFiatBalanceHidden = "IS_FIAT_BALANCE_HIDDEN";
static const String kHideTermsShortcut = "IS_OPEN_TERMS_SCREEN";
static const String kNextIdField = 'nextId';
static const String kUtxoSortOrder = 'UTXO_SORT_ORDER';
+ /// Home Features
+ static const String kWalletOrder = "WALLET_ORDER"; // 지갑 순서
+ static const String kFavoriteWalletIds = "FAVORITE_WALLET_IDS"; // 즐겨찾기된 지갑 목록
+ static const String kExcludedFromTotalBalanceWalletIds =
+ "EXCLUDED_FROM_TOTAL_BALANCE_WALLET_IDS"; // 홈화면 총 잔액에서 제외할 지갑 목록
+ static const String kHomeFeatures = "HOME_FEATURES"; // 홈 화면에 표시할 기능(최근 거래, 분석, ...)
+ static const String kAnalysisPeriod = "ANALYSIS_PERIOD"; // 분석 위젯에 사용되는 조회 기간
+ static const String kAnalysisPeriodStart = "ANALYSIS_PERIOD_START"; // 분석 위젯에 사용되는 조회 기간 시작 날짜
+ static const String kAnalysisPeriodEnd = "ANALYSIS_PERIOD_END"; // 분석 위젯에 사용되는 조회 기간 종료 날짜
+ static const String kSelectedTransactionTypeIndices = "SELECTED_TRANSACTION_TYPE_INDICES"; // 분석 위젯에 사용되는 거래 유형
+
/// 리뷰 요청 관련
static const String kHaveSent = 'HAVE_SENT';
static const String kHaveReviewed = 'HAVE_REVIEWED';
diff --git a/lib/model/preference/home_feature.dart b/lib/model/preference/home_feature.dart
new file mode 100644
index 000000000..6d59f528a
--- /dev/null
+++ b/lib/model/preference/home_feature.dart
@@ -0,0 +1,32 @@
+// 내용 변경시 RealmHomeFeature도 수정 필요
+class HomeFeature {
+ final String homeFeatureTypeString;
+ final bool isEnabled;
+ const HomeFeature({required this.homeFeatureTypeString, required this.isEnabled});
+
+ Map toJson() => {'homeFeatureTypeString': homeFeatureTypeString, 'isEnabled': isEnabled};
+
+ factory HomeFeature.fromJson(Map json) =>
+ HomeFeature(homeFeatureTypeString: json['homeFeatureTypeString'], isEnabled: json['isEnabled']);
+}
+
+// RealmHomeFeature 수정 불필요
+enum HomeFeatureType {
+ totalBalance,
+ walletList,
+ recentTransaction,
+ analysis;
+
+ String get assetPath {
+ switch (this) {
+ case HomeFeatureType.totalBalance:
+ return 'assets/svg/piggy-bank.svg';
+ case HomeFeatureType.walletList:
+ return 'assets/svg/wallet.svg';
+ case HomeFeatureType.recentTransaction:
+ return 'assets/svg/transaction.svg';
+ case HomeFeatureType.analysis:
+ return 'assets/svg/analysis.svg';
+ }
+ }
+}
diff --git a/lib/providers/node_provider/node_provider.dart b/lib/providers/node_provider/node_provider.dart
index 1c250b5aa..152721c46 100644
--- a/lib/providers/node_provider/node_provider.dart
+++ b/lib/providers/node_provider/node_provider.dart
@@ -45,6 +45,11 @@ class NodeProvider extends ChangeNotifier {
final _syncStateController = StreamController.broadcast();
final _walletStateController = StreamController