diff --git a/.github/workflows/auto_test_android.yaml b/.github/workflows/auto_test_android.yaml
index d82c6e2554..fe18795751 100644
--- a/.github/workflows/auto_test_android.yaml
+++ b/.github/workflows/auto_test_android.yaml
@@ -14,6 +14,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
# Set build number
+ - uses: subosito/flutter-action@v2
+ with:
+ flutter-version: "3.22.1"
+ channel: stable
- name: Set env
run: |
echo "FLUTTER_VERSION_NAME=0.100.0" >> $GITHUB_ENV
diff --git a/.github/workflows/auto_test_ios.yaml b/.github/workflows/auto_test_ios.yaml
index b106e019bf..3682793263 100644
--- a/.github/workflows/auto_test_ios.yaml
+++ b/.github/workflows/auto_test_ios.yaml
@@ -14,6 +14,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
# Set build number
+ - uses: subosito/flutter-action@v2
+ with:
+ flutter-version: "3.22.1"
+ channel: stable
- name: Set env
run: |
echo "FLUTTER_VERSION_NAME=0.100.0" >> $GITHUB_ENV
diff --git a/.github/workflows/bmvn_build_appcenter_android.yaml b/.github/workflows/bmvn_build_appcenter_android.yaml
index a177ab58df..155db59e14 100644
--- a/.github/workflows/bmvn_build_appcenter_android.yaml
+++ b/.github/workflows/bmvn_build_appcenter_android.yaml
@@ -30,7 +30,7 @@ on:
description: Using testnet (Default staging)
jobs:
build:
- runs-on: [ self-hosted, macm2, build-ci-local-bmvn, android ]
+ runs-on: [self-hosted, macm2, build-ci-local-bmvn, android]
steps:
- name: Extract Build number for Testnet
id: extract-version-testnet
@@ -57,7 +57,7 @@ jobs:
java-version: "17"
- uses: subosito/flutter-action@v2
with:
- flutter-version: "3.19.0"
+ flutter-version: "3.22.1"
channel: stable
- name: Set env
run: |
diff --git a/.github/workflows/bmvn_build_appcenter_ios.yaml b/.github/workflows/bmvn_build_appcenter_ios.yaml
index ca607cf26c..679368eeaa 100644
--- a/.github/workflows/bmvn_build_appcenter_ios.yaml
+++ b/.github/workflows/bmvn_build_appcenter_ios.yaml
@@ -32,13 +32,13 @@ on:
jobs:
fastlane-deploy:
- runs-on: [ self-hosted, macm2, build-ci-local-bmvn, ios ]
+ runs-on: [self-hosted, macm2, build-ci-local-bmvn, ios]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@v2
with:
- flutter-version: "3.19.0"
+ flutter-version: "3.22.1"
channel: stable
# - uses: maxim-lobanov/setup-xcode@v1
# with:
diff --git a/.github/workflows/ios-release-appcenter.yaml b/.github/workflows/ios-release-appcenter.yaml
index 392ca59405..e2a08a38fd 100644
--- a/.github/workflows/ios-release-appcenter.yaml
+++ b/.github/workflows/ios-release-appcenter.yaml
@@ -23,7 +23,7 @@ jobs:
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@v2
with:
- flutter-version: "3.19.0"
+ flutter-version: "3.22.1"
channel: stable
- uses: maxim-lobanov/setup-xcode@v1
with:
diff --git a/.github/workflows/ios-release-testflight.yaml b/.github/workflows/ios-release-testflight.yaml
index bf9c2450aa..244fd28583 100644
--- a/.github/workflows/ios-release-testflight.yaml
+++ b/.github/workflows/ios-release-testflight.yaml
@@ -18,7 +18,7 @@ jobs:
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@v2
with:
- flutter-version: "3.19.0"
+ flutter-version: "3.22.1"
channel: stable
- uses: maxim-lobanov/setup-xcode@v1
with:
diff --git a/README.md b/README.md
index d70f4474d4..700d3196ce 100644
--- a/README.md
+++ b/README.md
@@ -88,7 +88,7 @@ samples, guidance on mobile development, and a full API reference.
- [App Store](https://apps.apple.com/us/app/feral-file/id1544022728)
- [Google Play](https://play.google.com/store/apps/details?id=com.bitmark.autonomy_client&pli=)
-[Release Notes](https://github.com/bitmark-inc/autonomy-apps/tree/main/release_notes/production)
+[Release Notes](https://github.com/bitmark-inc/feral-file-docs/blob/master/app/release_notes/production/changelog.md)
## Contributing
diff --git a/assets b/assets
index 90b3a6a9ea..71655929f8 160000
--- a/assets
+++ b/assets
@@ -1 +1 @@
-Subproject commit 90b3a6a9eaf9586165535ef20d6e8be68ec25aca
+Subproject commit 71655929f8a0762ea663a973224863273ca8872e
diff --git a/ios/Runner-Inhouse-Info.plist b/ios/Runner-Inhouse-Info.plist
index 9e5b627866..1a70126ac1 100644
--- a/ios/Runner-Inhouse-Info.plist
+++ b/ios/Runner-Inhouse-Info.plist
@@ -39,7 +39,7 @@
tezos
autonomy-wc
autonomy-app
- feralfile
+ feralfile
@@ -59,6 +59,7 @@
_googlecast._tcp
_YOUR_APP_ID._googlecast._tcp
+ _feralFileCanvas._tcp
NSCameraUsageDescription
QR code scanning requires camera access.
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 60924ce267..f618f954fb 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -44,7 +44,7 @@
tezos
autonomy-wc
autonomy-app
- feralfile
+ feralfile
@@ -64,6 +64,7 @@
_googlecast._tcp
_YOUR_APP_ID._googlecast._tcp
+ _feralFileCanvas._tcp
NSCameraUsageDescription
QR code scanning requires camera access.
diff --git a/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc.mobileprovision b/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc.mobileprovision
index 9b847156ff..fb5af6c52e 100644
Binary files a/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc.mobileprovision and b/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc.mobileprovision differ
diff --git a/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc_Notification.mobileprovision b/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc_Notification.mobileprovision
index 9940c41738..9fc78d903e 100644
Binary files a/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc_Notification.mobileprovision and b/ios/fastlane/provisioning_profiles/Autonomy_Inhouse_Adhoc_Notification.mobileprovision differ
diff --git a/lib/common/environment.dart b/lib/common/environment.dart
index 3dcf625974..1a87ac097c 100644
--- a/lib/common/environment.dart
+++ b/lib/common/environment.dart
@@ -43,6 +43,8 @@ class Environment {
? connectWebsocketTestnetURL
: connectWebsocketMainnetURL;
+ static String get tvCastApiUrl => dotenv.env['TV_CAST_API_URL'] ?? '';
+
static String get tokenWebviewPrefix =>
dotenv.env['TOKEN_WEBVIEW_PREFIX'] ?? '';
@@ -151,9 +153,6 @@ class Environment {
static String get tzktTestnetURL => dotenv.env['TZKT_TESTNET_URL'] ?? '';
- static String get autonomyAirdropURL =>
- dotenv.env['AUTONOMY_AIRDROP_URL'] ?? '';
-
static String get autonomyAirDropContractAddress =>
dotenv.env['AUTONOMY_AIRDROP_CONTRACT_ADDRESS'] ?? '';
@@ -187,6 +186,8 @@ class Environment {
static String get sentryDSN => cachedSecretEnv['SENTRY_DSN'] ?? '';
static String get onesignalAppID => cachedSecretEnv['ONESIGNAL_APP_ID'] ?? '';
+
+ static String get tvKey => cachedSecretEnv['TV_API_KEY'] ?? '';
}
class Secret {
diff --git a/lib/common/injector.dart b/lib/common/injector.dart
index be36ed4652..8ca03357a6 100644
--- a/lib/common/injector.dart
+++ b/lib/common/injector.dart
@@ -7,13 +7,9 @@
// ignore_for_file: cascade_invocations
-import 'dart:math';
-
import 'package:autonomy_flutter/common/environment.dart';
import 'package:autonomy_flutter/database/app_database.dart';
import 'package:autonomy_flutter/database/cloud_database.dart';
-import 'package:autonomy_flutter/gateway/activation_api.dart';
-import 'package:autonomy_flutter/gateway/airdrop_api.dart';
import 'package:autonomy_flutter/gateway/announcement_api.dart';
import 'package:autonomy_flutter/gateway/autonomy_api.dart';
import 'package:autonomy_flutter/gateway/branch_api.dart';
@@ -26,25 +22,28 @@ import 'package:autonomy_flutter/gateway/iap_api.dart';
import 'package:autonomy_flutter/gateway/merchandise_api.dart';
import 'package:autonomy_flutter/gateway/postcard_api.dart';
import 'package:autonomy_flutter/gateway/pubdoc_api.dart';
+import 'package:autonomy_flutter/gateway/source_exhibition_api.dart';
+import 'package:autonomy_flutter/gateway/tv_cast_api.dart';
import 'package:autonomy_flutter/gateway/tzkt_api.dart';
import 'package:autonomy_flutter/screen/bloc/connections/connections_bloc.dart';
import 'package:autonomy_flutter/screen/bloc/identity/identity_bloc.dart';
+import 'package:autonomy_flutter/screen/bloc/subscription/subscription_bloc.dart';
import 'package:autonomy_flutter/screen/chat/chat_bloc.dart';
import 'package:autonomy_flutter/screen/collection_pro/collection_pro_bloc.dart';
+import 'package:autonomy_flutter/screen/detail/preview/canvas_device_bloc.dart';
+import 'package:autonomy_flutter/screen/exhibitions/exhibitions_bloc.dart';
import 'package:autonomy_flutter/screen/interactive_postcard/claim_empty_postcard/claim_empty_postcard_bloc.dart';
import 'package:autonomy_flutter/screen/playlists/add_new_playlist/add_new_playlist_bloc.dart';
import 'package:autonomy_flutter/screen/playlists/edit_playlist/edit_playlist_bloc.dart';
import 'package:autonomy_flutter/screen/playlists/view_playlist/view_playlist_bloc.dart';
import 'package:autonomy_flutter/screen/predefined_collection/predefined_collection_bloc.dart';
import 'package:autonomy_flutter/service/account_service.dart';
-import 'package:autonomy_flutter/service/activation_service.dart';
import 'package:autonomy_flutter/service/address_service.dart';
-import 'package:autonomy_flutter/service/airdrop_service.dart';
import 'package:autonomy_flutter/service/audit_service.dart';
import 'package:autonomy_flutter/service/auth_service.dart';
import 'package:autonomy_flutter/service/autonomy_service.dart';
import 'package:autonomy_flutter/service/backup_service.dart';
-import 'package:autonomy_flutter/service/canvas_client_service.dart';
+import 'package:autonomy_flutter/service/canvas_client_service_v2.dart';
import 'package:autonomy_flutter/service/chat_auth_service.dart';
import 'package:autonomy_flutter/service/chat_service.dart';
import 'package:autonomy_flutter/service/client_token_service.dart';
@@ -53,16 +52,20 @@ import 'package:autonomy_flutter/service/configuration_service.dart';
import 'package:autonomy_flutter/service/currency_service.dart';
import 'package:autonomy_flutter/service/customer_support_service.dart';
import 'package:autonomy_flutter/service/deeplink_service.dart';
+import 'package:autonomy_flutter/service/device_info_service.dart';
import 'package:autonomy_flutter/service/domain_service.dart';
import 'package:autonomy_flutter/service/ethereum_service.dart';
import 'package:autonomy_flutter/service/feralfile_service.dart';
import 'package:autonomy_flutter/service/hive_service.dart';
+import 'package:autonomy_flutter/service/hive_store_service.dart';
import 'package:autonomy_flutter/service/iap_service.dart';
import 'package:autonomy_flutter/service/keychain_service.dart';
import 'package:autonomy_flutter/service/merchandise_service.dart';
import 'package:autonomy_flutter/service/metric_client_service.dart';
import 'package:autonomy_flutter/service/mix_panel_client_service.dart';
import 'package:autonomy_flutter/service/navigation_service.dart';
+import 'package:autonomy_flutter/service/network_issue_manager.dart';
+import 'package:autonomy_flutter/service/network_service.dart';
import 'package:autonomy_flutter/service/notification_service.dart';
import 'package:autonomy_flutter/service/pending_token_service.dart';
import 'package:autonomy_flutter/service/playlist_service.dart';
@@ -74,15 +77,14 @@ import 'package:autonomy_flutter/service/tezos_service.dart';
import 'package:autonomy_flutter/service/versions_service.dart';
import 'package:autonomy_flutter/service/wc2_service.dart';
import 'package:autonomy_flutter/util/au_file_service.dart';
-import 'package:autonomy_flutter/util/constants.dart';
import 'package:autonomy_flutter/util/dio_interceptors.dart';
import 'package:autonomy_flutter/util/dio_util.dart';
import 'package:autonomy_flutter/util/log.dart';
import 'package:dio/dio.dart';
-import 'package:dio_smart_retry/dio_smart_retry.dart';
+import 'package:feralfile_app_tv_proto/feralfile_app_tv_proto.dart';
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
import 'package:get_it/get_it.dart';
-import 'package:http/http.dart';
+import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';
import 'package:nft_collection/data/api/indexer_api.dart';
import 'package:nft_collection/graphql/clients/indexer_client.dart';
@@ -91,7 +93,6 @@ import 'package:nft_collection/services/indexer_service.dart';
import 'package:nft_collection/services/tokens_service.dart';
import 'package:sentry_dio/sentry_dio.dart';
import 'package:shared_preferences/shared_preferences.dart';
-import 'package:tezart/tezart.dart';
import 'package:web3dart/web3dart.dart';
final injector = GetIt.instance;
@@ -127,6 +128,7 @@ Future setup() async {
migrateV15ToV16,
migrateV16ToV17,
migrateV17ToV18,
+ migrateV18ToV19,
]).build();
final cloudDB = await $FloorCloudDatabase
@@ -134,6 +136,11 @@ Future setup() async {
.addMigrations(cloudDatabaseMigrations)
.build();
+ injector.registerLazySingleton(() => NavigationService());
+
+ injector
+ .registerLazySingleton(() => NetworkIssueManager());
+
final BaseOptions dioOptions = BaseOptions(
followRedirects: true,
connectTimeout: const Duration(seconds: 3),
@@ -163,31 +170,19 @@ Future setup() async {
final authenticatedDio = Dio(); // Authenticated dio instance for AU servers
authenticatedDio.interceptors.add(AutonomyAuthInterceptor());
authenticatedDio.interceptors.add(LoggingInterceptor());
+ authenticatedDio.interceptors.add(ConnectingExceptionInterceptor());
(authenticatedDio.transformer as SyncTransformer).jsonDecodeCallback =
parseJson;
- dio.interceptors.add(RetryInterceptor(
- dio: dio,
- logPrint: (message) {
- log.warning('[request retry] $message');
- },
- retryDelays: const [
- // set delays between retries
- Duration(seconds: 1),
- Duration(seconds: 2),
- Duration(seconds: 3),
- ],
- ));
authenticatedDio.addSentry();
authenticatedDio.options = dioOptions;
+ injector.registerLazySingleton(() => NetworkService());
// Services
final auditService = AuditServiceImpl(cloudDB);
injector.registerSingleton(
ConfigurationServiceImpl(sharedPreferences));
-
- injector.registerLazySingleton(() => Client());
- injector.registerLazySingleton(() => NavigationService());
+ injector.registerLazySingleton(() => http.Client());
injector.registerLazySingleton(
() => AutonomyServiceImpl(injector(), injector()));
injector
@@ -223,6 +218,8 @@ Future setup() async {
injector.registerLazySingleton(() => BranchApi(dio));
injector.registerLazySingleton(
() => PubdocAPI(dio, baseUrl: Environment.pubdocURL));
+ injector.registerLazySingleton(
+ () => SourceExhibitionAPI(dio, baseUrl: Environment.pubdocURL));
injector.registerLazySingleton(
() => RemoteConfigServiceImpl(injector()));
injector.registerLazySingleton(
@@ -254,6 +251,8 @@ Future setup() async {
injector.registerLazySingleton(
() => IAPServiceImpl(injector(), injector()));
+ injector.registerLazySingleton(() =>
+ TvCastApi(tvCastDio(dioOptions), baseUrl: Environment.tvCastApiUrl));
injector.registerLazySingleton(() => Wc2Service(
injector(),
injector(),
@@ -269,7 +268,13 @@ Future setup() async {
injector.registerLazySingleton(
() => CustomerSupportServiceImpl(
mainnetDB.draftCustomerSupportDao,
- CustomerSupportApi(authenticatedDio,
+ CustomerSupportApi(
+ customerSupportDio(
+ dioOptions.copyWith(
+ connectTimeout: const Duration(seconds: 10),
+ receiveTimeout: const Duration(seconds: 10),
+ ),
+ ),
baseUrl: Environment.customerSupportURL),
injector(),
mainnetDB.announcementDao,
@@ -298,11 +303,6 @@ Future setup() async {
injector.registerLazySingleton(
() => ClientTokenService(injector(), injector(), injector(), injector()));
-
- final tezosNodeClientURL = Environment.appTestnetConfig
- ? Environment.tezosNodeClientTestnetURL
- : publicTezosNodes[Random().nextInt(publicTezosNodes.length)];
- injector.registerLazySingleton(() => TezartClient(tezosNodeClientURL));
injector.registerLazySingleton(() => FeralFileApi(
feralFileDio(dioOptions),
baseUrl: Environment.feralFileAPIURL));
@@ -319,17 +319,22 @@ Future setup() async {
injector.registerLazySingleton(
() => IndexerService(indexerClient));
- injector.registerLazySingleton(() =>
- EthereumServiceImpl(injector(), injector(), injector(), injector()));
+ injector.registerLazySingleton(() => EthereumServiceImpl(
+ injector(), injector(), injector(), injector(), injector()));
injector.registerLazySingleton(() => HiveServiceImpl());
injector
.registerLazySingleton(() => TezosServiceImpl(injector()));
injector.registerLazySingleton(() => mainnetDB);
injector.registerLazySingleton(
() => PlayListServiceImp(injector(), injector(), injector(), injector()));
+ injector.registerLazySingleton(() => DeviceInfoService());
- injector.registerLazySingleton(
- () => CanvasClientService(injector()));
+ injector.registerLazySingleton>(
+ () => HiveStoreObjectServiceImpl());
+ await injector>()
+ .init('local.canvas_device');
+ injector.registerLazySingleton(() =>
+ CanvasClientServiceV2(injector(), injector(), injector(), injector()));
injector.registerLazySingleton(
() => PostcardServiceImpl(
@@ -348,36 +353,9 @@ Future setup() async {
injector(),
));
- injector.registerLazySingleton(
- () => AirdropService(
- injector(),
- injector(),
- injector(),
- injector(),
- injector(),
- injector(),
- injector(),
- injector(),
- ),
- );
-
- injector.registerLazySingleton(() => ActivationService(
- injector(),
- injector(),
- injector(),
- ));
-
injector
.registerLazySingleton(() => NotificationService());
- injector.registerLazySingleton(() => AirdropApi(
- airdropDio(dioOptions.copyWith(followRedirects: true)),
- baseUrl: Environment.autonomyAirdropURL));
-
- injector.registerLazySingleton(() => ActivationApi(
- airdropDio(dioOptions.copyWith(followRedirects: true)),
- baseUrl: Environment.autonomyActivationURL));
-
injector.registerLazySingleton(() => FeralFileServiceImpl(
injector(),
injector(),
@@ -391,10 +369,6 @@ Future setup() async {
injector(),
injector(),
injector(),
- injector(),
- injector(),
- injector(),
- injector(),
));
injector.registerLazySingleton(() => PendingTokenService(
@@ -424,4 +398,10 @@ Future setup() async {
injector(),
injector(),
));
+ injector.registerLazySingleton(
+ () => CanvasDeviceBloc(injector()));
+ injector
+ .registerLazySingleton(() => ExhibitionBloc(injector()));
+ injector.registerLazySingleton(
+ () => SubscriptionBloc(injector()));
}
diff --git a/lib/database/app_database.dart b/lib/database/app_database.dart
index ed0509e5a2..10c4df8c23 100644
--- a/lib/database/app_database.dart
+++ b/lib/database/app_database.dart
@@ -8,14 +8,12 @@
import 'dart:async';
import 'package:autonomy_flutter/database/dao/announcement_dao.dart';
-import 'package:autonomy_flutter/database/dao/canvas_device_dao.dart';
import 'package:autonomy_flutter/database/dao/draft_customer_support_dao.dart';
import 'package:autonomy_flutter/database/dao/identity_dao.dart';
import 'package:autonomy_flutter/database/entity/announcement_local.dart';
import 'package:autonomy_flutter/database/entity/draft_customer_support.dart';
import 'package:autonomy_flutter/database/entity/identity.dart';
import 'package:autonomy_flutter/util/log.dart';
-import 'package:feralfile_app_tv_proto/feralfile_app_tv_proto.dart';
import 'package:floor/floor.dart';
import 'package:nft_collection/models/token.dart';
import 'package:sqflite/sqflite.dart' as sqflite;
@@ -25,12 +23,10 @@ import 'package:sqflite/sqflite.dart' as sqflite;
part 'app_database.g.dart'; // the generated code will be there
@TypeConverters([DateTimeConverter, TokenOwnersConverter])
-@Database(version: 17, entities: [
+@Database(version: 19, entities: [
Identity,
DraftCustomerSupport,
AnnouncementLocal,
- CanvasDevice,
- Scene,
])
abstract class AppDatabase extends FloorDatabase {
IdentityDao get identityDao;
@@ -39,16 +35,10 @@ abstract class AppDatabase extends FloorDatabase {
AnnouncementLocalDao get announcementDao;
- CanvasDeviceDao get canvasDeviceDao;
-
- SceneDao get sceneDao;
-
Future removeAll() async {
await identityDao.removeAll();
await draftCustomerSupportDao.removeAll();
await announcementDao.removeAll();
- await canvasDeviceDao.removeAll();
- await sceneDao.removeAll();
}
}
@@ -164,3 +154,8 @@ final migrateV17ToV18 = Migration(17, 18, (database) async {
await database.execute('DROP TABLE IF EXISTS Followee;');
log.info('Migrated App database from version 17 to 18');
});
+
+final migrateV18ToV19 = Migration(18, 19, (database) async {
+ await database.execute('DROP TABLE IF EXISTS CanvasDevice;');
+ await database.execute('DROP TABLE IF EXISTS Scene;');
+});
diff --git a/lib/database/app_database.g.dart b/lib/database/app_database.g.dart
index 4a7d5ceb0a..65bbc68c4c 100644
--- a/lib/database/app_database.g.dart
+++ b/lib/database/app_database.g.dart
@@ -67,17 +67,13 @@ class _$AppDatabase extends AppDatabase {
AnnouncementLocalDao? _announcementDaoInstance;
- CanvasDeviceDao? _canvasDeviceDaoInstance;
-
- SceneDao? _sceneDaoInstance;
-
Future open(
String path,
List migrations, [
Callback? callback,
]) async {
final databaseOptions = sqflite.OpenDatabaseOptions(
- version: 17,
+ version: 19,
onConfigure: (database) async {
await database.execute('PRAGMA foreign_keys = ON');
await callback?.onConfigure?.call(database);
@@ -98,10 +94,6 @@ class _$AppDatabase extends AppDatabase {
'CREATE TABLE IF NOT EXISTS `DraftCustomerSupport` (`uuid` TEXT NOT NULL, `issueID` TEXT NOT NULL, `type` TEXT NOT NULL, `data` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `reportIssueType` TEXT NOT NULL, `mutedMessages` TEXT NOT NULL, PRIMARY KEY (`uuid`))');
await database.execute(
'CREATE TABLE IF NOT EXISTS `AnnouncementLocal` (`announcementContextId` TEXT NOT NULL, `title` TEXT NOT NULL, `body` TEXT NOT NULL, `createdAt` INTEGER NOT NULL, `announceAt` INTEGER NOT NULL, `type` TEXT NOT NULL, `unread` INTEGER NOT NULL, PRIMARY KEY (`announcementContextId`))');
- await database.execute(
- 'CREATE TABLE IF NOT EXISTS `CanvasDevice` (`id` TEXT NOT NULL, `ip` TEXT NOT NULL, `port` INTEGER NOT NULL, `name` TEXT NOT NULL, `isConnecting` INTEGER NOT NULL, `playingSceneId` TEXT, PRIMARY KEY (`id`))');
- await database.execute(
- 'CREATE TABLE IF NOT EXISTS `Scene` (`id` TEXT NOT NULL, `deviceId` TEXT NOT NULL, `isPlaying` INTEGER NOT NULL, `metadata` TEXT NOT NULL, PRIMARY KEY (`id`))');
await callback?.onCreate?.call(database, version);
},
@@ -125,17 +117,6 @@ class _$AppDatabase extends AppDatabase {
return _announcementDaoInstance ??=
_$AnnouncementLocalDao(database, changeListener);
}
-
- @override
- CanvasDeviceDao get canvasDeviceDao {
- return _canvasDeviceDaoInstance ??=
- _$CanvasDeviceDao(database, changeListener);
- }
-
- @override
- SceneDao get sceneDao {
- return _sceneDaoInstance ??= _$SceneDao(database, changeListener);
- }
}
class _$IdentityDao extends IdentityDao {
@@ -438,198 +419,6 @@ class _$AnnouncementLocalDao extends AnnouncementLocalDao {
}
}
-class _$CanvasDeviceDao extends CanvasDeviceDao {
- _$CanvasDeviceDao(
- this.database,
- this.changeListener,
- ) : _queryAdapter = QueryAdapter(database),
- _canvasDeviceInsertionAdapter = InsertionAdapter(
- database,
- 'CanvasDevice',
- (CanvasDevice item) => {
- 'id': item.id,
- 'ip': item.ip,
- 'port': item.port,
- 'name': item.name,
- 'isConnecting': item.isConnecting ? 1 : 0,
- 'playingSceneId': item.playingSceneId
- }),
- _canvasDeviceUpdateAdapter = UpdateAdapter(
- database,
- 'CanvasDevice',
- ['id'],
- (CanvasDevice item) => {
- 'id': item.id,
- 'ip': item.ip,
- 'port': item.port,
- 'name': item.name,
- 'isConnecting': item.isConnecting ? 1 : 0,
- 'playingSceneId': item.playingSceneId
- }),
- _canvasDeviceDeletionAdapter = DeletionAdapter(
- database,
- 'CanvasDevice',
- ['id'],
- (CanvasDevice item) => {
- 'id': item.id,
- 'ip': item.ip,
- 'port': item.port,
- 'name': item.name,
- 'isConnecting': item.isConnecting ? 1 : 0,
- 'playingSceneId': item.playingSceneId
- });
-
- final sqflite.DatabaseExecutor database;
-
- final StreamController changeListener;
-
- final QueryAdapter _queryAdapter;
-
- final InsertionAdapter _canvasDeviceInsertionAdapter;
-
- final UpdateAdapter _canvasDeviceUpdateAdapter;
-
- final DeletionAdapter _canvasDeviceDeletionAdapter;
-
- @override
- Future> getCanvasDevices() async {
- return _queryAdapter.queryList('SELECT * FROM CanvasDevice',
- mapper: (Map row) => CanvasDevice(
- id: row['id'] as String,
- ip: row['ip'] as String,
- port: row['port'] as int,
- name: row['name'] as String,
- isConnecting: (row['isConnecting'] as int) != 0,
- playingSceneId: row['playingSceneId'] as String?));
- }
-
- @override
- Future removeAll() async {
- await _queryAdapter.queryNoReturn('DELETE FROM CanvasDevice');
- }
-
- @override
- Future insertCanvasDevice(CanvasDevice canvasDevice) async {
- await _canvasDeviceInsertionAdapter.insert(
- canvasDevice, OnConflictStrategy.replace);
- }
-
- @override
- Future insertCanvasDevices(List canvasDevices) async {
- await _canvasDeviceInsertionAdapter.insertList(
- canvasDevices, OnConflictStrategy.replace);
- }
-
- @override
- Future updateCanvasDevice(CanvasDevice canvasDevice) async {
- await _canvasDeviceUpdateAdapter.update(
- canvasDevice, OnConflictStrategy.abort);
- }
-
- @override
- Future deleteCanvasDevice(CanvasDevice canvasDevice) async {
- await _canvasDeviceDeletionAdapter.delete(canvasDevice);
- }
-}
-
-class _$SceneDao extends SceneDao {
- _$SceneDao(
- this.database,
- this.changeListener,
- ) : _queryAdapter = QueryAdapter(database),
- _sceneInsertionAdapter = InsertionAdapter(
- database,
- 'Scene',
- (Scene item) => {
- 'id': item.id,
- 'deviceId': item.deviceId,
- 'isPlaying': item.isPlaying ? 1 : 0,
- 'metadata': item.metadata
- }),
- _sceneUpdateAdapter = UpdateAdapter(
- database,
- 'Scene',
- ['id'],
- (Scene item) => {
- 'id': item.id,
- 'deviceId': item.deviceId,
- 'isPlaying': item.isPlaying ? 1 : 0,
- 'metadata': item.metadata
- });
-
- final sqflite.DatabaseExecutor database;
-
- final StreamController changeListener;
-
- final QueryAdapter _queryAdapter;
-
- final InsertionAdapter _sceneInsertionAdapter;
-
- final UpdateAdapter _sceneUpdateAdapter;
-
- @override
- Future> getScenes() async {
- return _queryAdapter.queryList('SELECT * FROM Scene',
- mapper: (Map row) => Scene(
- id: row['id'] as String,
- deviceId: row['deviceId'] as String,
- metadata: row['metadata'] as String,
- isPlaying: (row['isPlaying'] as int) != 0));
- }
-
- @override
- Future> getScenesByDeviceId(String deviceId) async {
- return _queryAdapter.queryList('SELECT * FROM Scene WHERE deviceId = ?1',
- mapper: (Map row) => Scene(
- id: row['id'] as String,
- deviceId: row['deviceId'] as String,
- metadata: row['metadata'] as String,
- isPlaying: (row['isPlaying'] as int) != 0),
- arguments: [deviceId]);
- }
-
- @override
- Future getSceneById(String id) async {
- return _queryAdapter.query('SELECT * FROM Scene WHERE id = ?1',
- mapper: (Map row) => Scene(
- id: row['id'] as String,
- deviceId: row['deviceId'] as String,
- metadata: row['metadata'] as String,
- isPlaying: (row['isPlaying'] as int) != 0),
- arguments: [id]);
- }
-
- @override
- Future updateSceneMetadata(
- String id,
- String metadata,
- ) async {
- await _queryAdapter.queryNoReturn(
- 'UPDATE Scene SET metadata = ?2 WHERE id = ?1',
- arguments: [id, metadata]);
- }
-
- @override
- Future removeAll() async {
- await _queryAdapter.queryNoReturn('DELETE FROM Scene');
- }
-
- @override
- Future insertScene(Scene scene) async {
- await _sceneInsertionAdapter.insert(scene, OnConflictStrategy.replace);
- }
-
- @override
- Future insertScenes(List scenes) async {
- await _sceneInsertionAdapter.insertList(scenes, OnConflictStrategy.replace);
- }
-
- @override
- Future updateScene(Scene scene) async {
- await _sceneUpdateAdapter.update(scene, OnConflictStrategy.abort);
- }
-}
-
// ignore_for_file: unused_element
final _dateTimeConverter = DateTimeConverter();
final _tokenOwnersConverter = TokenOwnersConverter();
diff --git a/lib/database/cloud_database.g.dart b/lib/database/cloud_database.g.dart
index 72fa370ecd..0f823bf508 100644
--- a/lib/database/cloud_database.g.dart
+++ b/lib/database/cloud_database.g.dart
@@ -723,6 +723,29 @@ class _$WalletAddressDao extends WalletAddressDao {
await _queryAdapter.queryNoReturn('DELETE FROM WalletAddress');
}
+ @override
+ Future deleteAddressesByPersona(String uuid) async {
+ await _queryAdapter.queryNoReturn(
+ 'DELETE FROM WalletAddress WHERE uuid = ?1',
+ arguments: [uuid]);
+ }
+
+ @override
+ Future> getAddressesByPersona(String uuid) async {
+ return _queryAdapter.queryList(
+ 'SELECT * FROM WalletAddress WHERE uuid = ?1',
+ mapper: (Map row) => WalletAddress(
+ address: row['address'] as String,
+ uuid: row['uuid'] as String,
+ index: row['index'] as int,
+ cryptoType: row['cryptoType'] as String,
+ createdAt: _dateTimeConverter.decode(row['createdAt'] as int),
+ isHidden: (row['isHidden'] as int) != 0,
+ name: row['name'] as String?,
+ accountOrder: row['accountOrder'] as int?),
+ arguments: [uuid]);
+ }
+
@override
Future insertAddress(WalletAddress address) async {
await _walletAddressInsertionAdapter.insert(
diff --git a/lib/database/dao/address_dao.dart b/lib/database/dao/address_dao.dart
index f563b3df32..aa59ca09c4 100644
--- a/lib/database/dao/address_dao.dart
+++ b/lib/database/dao/address_dao.dart
@@ -46,4 +46,12 @@ abstract class WalletAddressDao {
@Query('DELETE FROM WalletAddress')
Future removeAll();
+
+ // deleteAddresses by persona
+ @Query('DELETE FROM WalletAddress WHERE uuid = :uuid')
+ Future deleteAddressesByPersona(String uuid);
+
+ // get addresses by persona
+ @Query('SELECT * FROM WalletAddress WHERE uuid = :uuid')
+ Future> getAddressesByPersona(String uuid);
}
diff --git a/lib/database/dao/canvas_device_dao.dart b/lib/database/dao/canvas_device_dao.dart
deleted file mode 100644
index 63f29bb92f..0000000000
--- a/lib/database/dao/canvas_device_dao.dart
+++ /dev/null
@@ -1,50 +0,0 @@
-import 'package:feralfile_app_tv_proto/feralfile_app_tv_proto.dart';
-import 'package:floor/floor.dart';
-
-@dao
-abstract class CanvasDeviceDao {
- @Query('SELECT * FROM CanvasDevice')
- Future> getCanvasDevices();
-
- @Insert(onConflict: OnConflictStrategy.replace)
- Future insertCanvasDevice(CanvasDevice canvasDevice);
-
- @Insert(onConflict: OnConflictStrategy.replace)
- Future insertCanvasDevices(List canvasDevices);
-
- @update
- Future updateCanvasDevice(CanvasDevice canvasDevice);
-
- @delete
- Future deleteCanvasDevice(CanvasDevice canvasDevice);
-
- @Query('DELETE FROM CanvasDevice')
- Future removeAll();
-}
-
-@dao
-abstract class SceneDao {
- @Query('SELECT * FROM Scene')
- Future> getScenes();
-
- @Query('SELECT * FROM Scene WHERE deviceId = :deviceId')
- Future> getScenesByDeviceId(String deviceId);
-
- @Query('SELECT * FROM Scene WHERE id = :id')
- Future getSceneById(String id);
-
- @Query('UPDATE Scene SET metadata = :metadata WHERE id = :id')
- Future updateSceneMetadata(String id, String metadata);
-
- @Insert(onConflict: OnConflictStrategy.replace)
- Future insertScene(Scene scene);
-
- @Insert(onConflict: OnConflictStrategy.replace)
- Future insertScenes(List scenes);
-
- @update
- Future updateScene(Scene scene);
-
- @Query('DELETE FROM Scene')
- Future removeAll();
-}
diff --git a/lib/gateway/activation_api.dart b/lib/gateway/activation_api.dart
deleted file mode 100644
index 36f69c1572..0000000000
--- a/lib/gateway/activation_api.dart
+++ /dev/null
@@ -1,80 +0,0 @@
-import 'package:dio/dio.dart';
-import 'package:retrofit/retrofit.dart';
-
-part 'activation_api.g.dart';
-
-@RestApi(baseUrl: "")
-abstract class ActivationApi {
- factory ActivationApi(Dio dio, {String baseUrl}) = _ActivationApi;
-
- @GET("/v1/activation/{activation_id}")
- Future getActivation(
- @Path("activation_id") String activationId);
-
- @POST("/v1/activation/claim")
- Future claim(@Body() ActivationClaimRequest body);
-}
-
-class ActivationInfo {
- String name;
- String description;
- String blockchain;
- String contractAddress;
- String tokenID;
-
- ActivationInfo(this.name, this.description, this.blockchain,
- this.contractAddress, this.tokenID);
-
- factory ActivationInfo.fromJson(Map json) {
- return ActivationInfo(
- json['name'],
- json['description'],
- json['blockchain'],
- json['contractAddress'],
- json['tokenID'],
- );
- }
-
- Map toJson() => {
- 'name': name,
- 'description': description,
- 'blockchain': blockchain,
- 'contractAddress': contractAddress,
- 'tokenID': tokenID,
- };
-}
-
-class ActivationClaimRequest {
- String activationID;
- String address;
- String airdropTOTPPasscode;
-
- ActivationClaimRequest(
- {required this.activationID,
- required this.address,
- required this.airdropTOTPPasscode});
-
- Map toJson() => {
- 'activationID': activationID,
- 'address': address,
- 'airdropTOTPPasscode': airdropTOTPPasscode,
- };
-
- factory ActivationClaimRequest.fromJson(Map json) {
- return ActivationClaimRequest(
- activationID: json['activationID'],
- address: json['address'],
- airdropTOTPPasscode: json['airdropTOTPPasscode'],
- );
- }
-}
-
-class ActivationClaimResponse {
- ActivationClaimResponse();
-
- factory ActivationClaimResponse.fromJson(Map json) {
- return ActivationClaimResponse();
- }
-
- Map toJson() => {};
-}
diff --git a/lib/gateway/airdrop_api.dart b/lib/gateway/airdrop_api.dart
deleted file mode 100644
index c19a023934..0000000000
--- a/lib/gateway/airdrop_api.dart
+++ /dev/null
@@ -1,30 +0,0 @@
-import 'package:autonomy_flutter/model/ff_account.dart';
-import 'package:autonomy_flutter/service/airdrop_service.dart';
-import 'package:dio/dio.dart';
-import 'package:retrofit/retrofit.dart';
-
-part 'airdrop_api.g.dart';
-
-@RestApi(baseUrl: '')
-abstract class AirdropApi {
- factory AirdropApi(Dio dio, {String baseUrl}) = _AirdropApi;
-
- @POST('/v1/claim/request')
- Future requestClaim(
- @Body() AirdropRequestClaimRequest body);
-
- @POST('/v1/claim')
- Future claim(@Body() AirdropClaimRequest body);
-
- @GET('/v1/claim/{share_code}')
- Future claimShare(
- @Path('share_code') String shareCode);
-
- @POST('/v1/share/{token_id}')
- Future share(
- @Path('token_id') String tokenId, @Body() AirdropShareRequest body);
-
- @POST('/v1/feralfile-claim')
- Future feralfileClaim(
- @Body() FeralFileTokenClaimRequest body);
-}
diff --git a/lib/gateway/airdrop_api.g.dart b/lib/gateway/airdrop_api.g.dart
deleted file mode 100644
index e7ba06cdf9..0000000000
--- a/lib/gateway/airdrop_api.g.dart
+++ /dev/null
@@ -1,194 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'airdrop_api.dart';
-
-// **************************************************************************
-// RetrofitGenerator
-// **************************************************************************
-
-// ignore_for_file: unnecessary_brace_in_string_interps,no_leading_underscores_for_local_identifiers
-
-class _AirdropApi implements AirdropApi {
- _AirdropApi(
- this._dio, {
- this.baseUrl,
- });
-
- final Dio _dio;
-
- String? baseUrl;
-
- @override
- Future requestClaim(
- AirdropRequestClaimRequest body) async {
- const _extra = {};
- final queryParameters = {};
- final _headers = {};
- final _data = {};
- _data.addAll(body.toJson());
- final _result = await _dio.fetch