Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove postcard related code #2343

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets
5 changes: 0 additions & 5 deletions lib/common/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ class Environment {
static String get cloudFlareImageUrlPrefix =>
_readKey('CLOUD_FLARE_IMAGE_URL_PREFIX', '');

static String get postcardContractAddress =>
_readKey('POSTCARD_CONTRACT_ADDRESS', '');

static String get merchandiseBaseUrl =>
_readKey('AUTONOMY_MERCHANDISE_BASE_URL', '');

Expand All @@ -176,8 +173,6 @@ class Environment {

static String get payToMintBaseUrl => _readKey('PAY_TO_MINT_BASE_URL', '');

static String get postcardChatServerUrl => _readKey('CHAT_SERVER_URL', '');

static String get tzktMainnetURL => _readKey('TZKT_MAINNET_URL', '');

static String get tzktTestnetURL => _readKey('TZKT_TESTNET_URL', '');
Expand Down
2 changes: 0 additions & 2 deletions lib/screen/home/collection_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ class CollectionHomePageState extends State<CollectionHomePage>
}

Future<void> _onTokensUpdate(List<CompactedAssetToken> tokens) async {
//check minted postcard and navigator to artwork detail

// Check if there is any Tezos token in the list
final List<String> allAccountNumbers =
_addressService.getAllWalletAddresses().map((e) => e.address).toList();
Expand Down
19 changes: 0 additions & 19 deletions lib/service/configuration_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class ConfigurationServiceImpl implements ConfigurationService {
'last_pull_announcement_time';
static const String KEY_HAS_MERCHANDISE_SUPPORT_INDEX_ID =
'has_merchandise_support';
static const String KEY_POSTCARD_CHAT_CONFIG = 'postcard_chat_config';
static const String KEY_DID_MIGRATE_ADDRESS = 'did_migrate_address';
static const String KEY_HIDDEN_FEEDS = 'hidden_feeds';
static const String KEY_IAP_RECEIPT = 'key_iap_receipt';
Expand All @@ -180,7 +179,6 @@ class ConfigurationServiceImpl implements ConfigurationService {
static const String KEY_READ_RELEASE_NOTES_VERSION =
'read_release_notes_version';
static const String ACCOUNT_HMAC_SECRET = 'account_hmac_secret';
static const String KEY_SHARED_POSTCARD = 'shared_postcard';

static const String ANNOUNCEMENT_LAST_PULL_TIME =
'announcement_last_pull_time';
Expand All @@ -204,27 +202,12 @@ class ConfigurationServiceImpl implements ConfigurationService {

static const String KEY_SUBSCRIPTION_TIME = 'subscription_time';

static const String KEY_STAMPING_POSTCARD = 'stamping_postcard';

static const String KEY_AUTO_SHOW_POSTCARD = 'auto_show_postcard';

static const String KEY_ALREADY_SHOW_YOU_DID_IT_POSTCARD =
'already_show_you_did_it_postcard';

static const String KEY_CURRENT_GROUP_CHAT_ID = 'current_group_chat_id';

static const String KEY_ALREADY_SHOW_POSTCARD_UPDATES =
'already_show_postcard_updates';

static const String KEY_MIXPANEL_PROPS = 'mixpanel_props';

static const String KEY_PACKAGE_INFO = 'package_info';

static const String KEY_PROCESSING_STAMP_POSTCARD =
'processing_stamp_postcard';

static const String KEY_SHOW_POSTCARD_BANNER = 'show_postcard_banner';

static const String KEY_SHOW_ADD_ADDRESS_BANNER = 'show_add_address_banner';

static const String KEY_MERCHANDISE_ORDER_IDS = 'merchandise_order_ids';
Expand All @@ -235,8 +218,6 @@ class ConfigurationServiceImpl implements ConfigurationService {
static const String KEY_SENT_TEZOS_ARTWORK_METRIC =
'sent_tezos_artwork_metric';

static const String POSTCARD_MINT = 'postcard_mint';

final SharedPreferences _preferences;

ConfigurationServiceImpl(this._preferences);
Expand Down
14 changes: 1 addition & 13 deletions lib/service/remote_config_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class RemoteConfigServiceImpl implements RemoteConfigService {
'enable': true,
'allow_view_only': true,
'must_complete': true,
'postcard_tokenId_regex':
r'^tez-KT1Rg1hhAPD8HSKaNKV6zuu7y8Zuk4QXaq2V-(1699413090857|1699951798888|1692601505415)$'
},
'pay_to_mint': {'enable': true, 'allow_view_only': true},
'view_detail': {
Expand All @@ -39,8 +37,7 @@ class RemoteConfigServiceImpl implements RemoteConfigService {
'rights': true,
'chat': true
},
'feature': {'download_stamp': true, 'download_postcard': true},
'postcard_action': {'wait_confirmed_to_send': false},
'feature': {'download_stamp': true},
'feralfile_artwork_action': {
'allow_download_artwork_contracts': [
'KT19VkuK7tw22m4P36xRpPiMT4qzEw8YAN8A',
Expand Down Expand Up @@ -195,7 +192,6 @@ enum ConfigGroup {
payToMint,
viewDetail,
feature,
postcardAction,
feralfileArtworkAction,
inAppWebView,
dAppUrls,
Expand All @@ -218,8 +214,6 @@ extension ConfigGroupExtension on ConfigGroup {
return 'view_detail';
case ConfigGroup.feature:
return 'feature';
case ConfigGroup.postcardAction:
return 'postcard_action';
case ConfigGroup.feralfileArtworkAction:
return 'feralfile_artwork_action';
case ConfigGroup.inAppWebView:
Expand All @@ -244,7 +238,6 @@ enum ConfigKey {
enable,
allowViewOnly,
mustCompleted,
postcardTokenIdRegex,
actionButton,
leaderBoard,
aboutMoma,
Expand All @@ -254,7 +247,6 @@ enum ConfigKey {
provenance,
rights,
downloadStamp,
downloadPostcard,
chat,
waitConfirmedToSend,
allowDownloadArtworkContracts,
Expand Down Expand Up @@ -288,8 +280,6 @@ extension ConfigKeyExtension on ConfigKey {
return 'allow_view_only';
case ConfigKey.mustCompleted:
return 'must_complete';
case ConfigKey.postcardTokenIdRegex:
return 'postcard_tokenId_regex';
case ConfigKey.actionButton:
return 'action_button';
case ConfigKey.leaderBoard:
Expand All @@ -308,8 +298,6 @@ extension ConfigKeyExtension on ConfigKey {
return 'rights';
case ConfigKey.downloadStamp:
return 'download_stamp';
case ConfigKey.downloadPostcard:
return 'download_postcard';
case ConfigKey.chat:
return 'chat';
case ConfigKey.waitConfirmedToSend:
Expand Down
8 changes: 0 additions & 8 deletions lib/util/asset_token_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ extension AssetTokenExtension on AssetToken {
return null;
}

void updatePostcardCID(String cid) {
if (Environment.appTestnetConfig) {
asset?.previewURL = '$POSTCARD_IPFS_PREFIX_TEST/$cid/';
} else {
asset?.previewURL = '$POSTCARD_IPFS_PREFIX_PROD/$cid/';
}
}

String? getBlockchainUrl() {
final network = Environment.appTestnetConfig ? 'TESTNET' : 'MAINNET';
switch ('${network}_$blockchain') {
Expand Down
17 changes: 0 additions & 17 deletions lib/util/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:autonomy_flutter/util/xtz_utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:feralfile_app_theme/feral_file_app_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart';
import 'package:package_info_plus/package_info_plus.dart';

// ignore_for_file: constant_identifier_names
Expand Down Expand Up @@ -53,9 +52,6 @@ const MOMA_MEMENTO_EXHIBITION_IDS = [

const cloudFlarePrefix = 'https://imagedelivery.net/';

const POSTCARD_IPFS_PREFIX_TEST = 'https://ipfs.test.bitmark.com/ipfs';
const POSTCARD_IPFS_PREFIX_PROD = 'https://ipfs.bitmark.com/ipfs';

const TEIA_ART_CONTRACT_ADDRESSES = ['KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton'];
const OPENSEA_ASSET_PREFIX = 'https://opensea.io/assets/';
const OBJKT_ASSET_PREFIX_MAINNET = 'https://objkt.com/asset/';
Expand Down Expand Up @@ -137,9 +133,6 @@ const double cellSpacing = 3;
const TV_APP_STORE_URL =
'https://play.google.com/store/apps/details?id=com.bitmark.autonomy_tv';

const MOMA_TERMS_CONDITIONS_URL =
'https://github.com/bitmark-inc/autonomy-apps/blob/main/docs/postcard_terms.md';

const AUTONOMY_DOCUMENT_PREFIX = 'https://github.com/bitmark-inc';

const AUTONOMY_RAW_DOCUMENT_PREFIX =
Expand Down Expand Up @@ -425,7 +418,6 @@ class LinkType {
static const beaconConnect = 'Beacon Connect';
static const feralFileToken = 'FeralFile Token';
static const walletConnect = 'Wallet Connect';
static const postcardPayToMint = 'Postcard Pay To Mint';
static const undefined = 'Undefined';
}

Expand All @@ -442,12 +434,3 @@ class KeyChain {
class IrlWebviewFunction {
static String closeWebview = '_closeWebview';
}

const chatPrivateBannerId = 'chat_private_banner_id';
final chatPrivateBannerMessage = SystemMessage(
id: chatPrivateBannerId,
author: const User(id: chatPrivateBannerId),
createdAt: 0,
text: 'chat_is_private'.tr(),
status: Status.delivered,
);
7 changes: 0 additions & 7 deletions lib/util/string_ext.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// that can be found in the LICENSE file.
//

import 'package:autonomy_flutter/common/environment.dart';
import 'package:autonomy_flutter/nft_rendering/nft_rendering_widget.dart';
import 'package:autonomy_flutter/util/constants.dart';

Expand Down Expand Up @@ -80,12 +79,6 @@ extension StringExtension on String {
}
}

bool get isPostcardId {
final splitted = split('-');
return splitted.length > 1 &&
splitted[1] == Environment.postcardContractAddress;
}

bool get isAutonomyDocumentLink =>
(startsWith(AUTONOMY_DOCUMENT_PREFIX) ||
startsWith(AUTONOMY_RAW_DOCUMENT_PREFIX)) &&
Expand Down
74 changes: 0 additions & 74 deletions lib/util/style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import 'package:autonomy_flutter/util/log.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:feralfile_app_theme/extensions/theme_extension/moma_sans.dart';
import 'package:feralfile_app_theme/feral_file_app_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -175,79 +174,6 @@ MarkdownStyleSheet markDownRightStyle(BuildContext context) {
);
}

MarkdownStyleSheet markDownPostcardRightStyle(BuildContext context) {
final theme = Theme.of(context);
final baseStyle = theme.textTheme.moMASans400Black12;
final bodyText2 = theme.textTheme.ppMori400Black14;
return MarkdownStyleSheet(
a: baseStyle.copyWith(
color: Colors.transparent,
decoration: TextDecoration.underline,
shadows: [
const Shadow(
offset: Offset(0, -1),
),
],
decorationStyle: TextDecorationStyle.solid,
decorationColor: Colors.black,
),
p: baseStyle,
pPadding: const EdgeInsets.symmetric(horizontal: 15),
code: bodyText2.copyWith(backgroundColor: Colors.transparent),
h1: baseStyle.copyWith(fontSize: 16),
h1Padding: EdgeInsets.zero,
h2: baseStyle.copyWith(fontSize: 16),
h2Padding: EdgeInsets.zero,
h3: baseStyle.copyWith(fontSize: 16),
h3Padding: EdgeInsets.zero,
h4: baseStyle.copyWith(fontSize: 16),
h4Padding: EdgeInsets.zero,
h5: baseStyle.copyWith(fontSize: 16),
h5Padding: EdgeInsets.zero,
h6: baseStyle.copyWith(fontSize: 16),
h6Padding: EdgeInsets.zero,
em: const TextStyle(fontStyle: FontStyle.normal, color: Colors.black),
strong: baseStyle.copyWith(color: AppColor.auQuickSilver),
del: const TextStyle(
decoration: TextDecoration.lineThrough,
color: Colors.white,
),
blockquote: bodyText2,
img: bodyText2,
checkbox: bodyText2.copyWith(color: theme.colorScheme.secondary),
blockSpacing: 16,
listIndent: 24,
listBullet: bodyText2.copyWith(color: Colors.black),
listBulletPadding: const EdgeInsets.only(right: 4),
tableHead: const TextStyle(fontWeight: FontWeight.w600),
tableBody: bodyText2,
tableHeadAlign: TextAlign.center,
tableBorder: TableBorder.all(
color: theme.dividerColor,
),
tableColumnWidth: const FlexColumnWidth(),
tableCellsPadding: const EdgeInsets.fromLTRB(16, 8, 16, 8),
tableCellsDecoration: const BoxDecoration(),
blockquotePadding: const EdgeInsets.all(8),
blockquoteDecoration: BoxDecoration(
color: Colors.blue.shade100,
borderRadius: BorderRadius.circular(2),
),
codeblockPadding: const EdgeInsets.all(8),
codeblockDecoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.circular(2),
),
horizontalRuleDecoration: const BoxDecoration(
border: Border(
top: BorderSide(
color: Color.fromRGBO(236, 236, 236, 1),
),
),
),
);
}

MarkdownStyleSheet markDownAnnouncementStyle(BuildContext context) {
final theme = Theme.of(context);
final bodyText2 = theme.textTheme.ppMori400White12;
Expand Down
Loading