Changed version for unstoppable domains. Changed domain validation for unstoppable domains.

This commit is contained in:
M 2021-08-16 12:42:16 +03:00
parent cd45a2af7f
commit c256d05029
4 changed files with 20 additions and 15 deletions

View file

@ -88,7 +88,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.unstoppabledomains:resolution:1.13.0'
implementation 'com.unstoppabledomains:resolution:3.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
implementation 'com.google.firebase:firebase-messaging:19.0.0'
}

View file

@ -36,7 +36,7 @@ target 'Runner' do
# Cake Wallet (Legacy)
pod 'CryptoSwift'
pod 'UnstoppableDomainsResolution', '~> 0.3.6'
pod 'UnstoppableDomainsResolution', '~> 2.0.1'
pod 'Firebase/Messaging', '6.33.0'
end

View file

@ -60,8 +60,6 @@ PODS:
- SwiftyGif
- esys_flutter_share (0.0.1):
- Flutter
- EthereumAddress (1.3.0):
- CryptoSwift (~> 1.0)
- file_picker (0.0.1):
- DKImagePickerController/PhotoGallery
- Flutter
@ -153,10 +151,9 @@ PODS:
- Flutter
- SwiftProtobuf (1.12.0)
- SwiftyGif (5.3.0)
- UnstoppableDomainsResolution (0.3.6):
- UnstoppableDomainsResolution (2.0.1):
- BigInt
- CryptoSwift (~> 1.0)
- EthereumAddress (~> 1.3)
- CryptoSwift
- url_launcher (0.0.1):
- Flutter
- webview_flutter (0.0.1):
@ -181,7 +178,7 @@ DEPENDENCIES:
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- share (from `.symlinks/plugins/share/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- UnstoppableDomainsResolution (~> 0.3.6)
- UnstoppableDomainsResolution (~> 2.0.1)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
@ -191,7 +188,6 @@ SPEC REPOS:
- CryptoSwift
- DKImagePickerController
- DKPhotoGallery
- EthereumAddress
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
@ -258,7 +254,6 @@ SPEC CHECKSUMS:
DKImagePickerController: b5eb7f7a388e4643264105d648d01f727110fc3d
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
esys_flutter_share: 403498dab005b36ce1f8d7aff377e81f0621b0b4
EthereumAddress: 39fe8e11cf04e4e9902b55ae653dbc4e0aee5f30
file_picker: 3e6c3790de664ccf9b882732d9db5eaf6b8d4eb1
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
@ -286,10 +281,10 @@ SPEC CHECKSUMS:
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
SwiftProtobuf: 4ef85479c18ca85b5482b343df9c319c62bda699
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
UnstoppableDomainsResolution: 63abb84858d3e91eb838a5bfa6f7e3c0e0593f24
UnstoppableDomainsResolution: 856ba43f08b31f3f34157c7257092bd0c6e31cf8
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
webview_flutter: 9f491a9b5a66f2573946a389b2677987b0ff8c0b
PODFILE CHECKSUM: 82161cafcb98ddf3e6a0ff8149da3f656be3f1e3
PODFILE CHECKSUM: 2e3a44b4309d141b9a3b43acf609feb2beb43d9b
COCOAPODS: 1.9.3
COCOAPODS: 1.10.2

View file

@ -2,7 +2,17 @@ import 'package:cake_wallet/entities/openalias_record.dart';
import 'package:cake_wallet/entities/parsed_address.dart';
import 'package:cake_wallet/entities/unstoppable_domain_address.dart';
const topLevelDomain = 'crypto';
const unstoppableDomains = [
'crypto',
'zil',
'x',
'coin',
'wallet',
'bitcoin',
'888',
'nft',
'dao',
'blockchain'];
Future<ParsedAddress> parseAddressFromDomain(
String domain, String ticker) async {
@ -15,7 +25,7 @@ Future<ParsedAddress> parseAddressFromDomain(
return ParsedAddress(address: domain);
}
if (name.contains(topLevelDomain)) {
if (unstoppableDomains.any((domain) => name.contains(domain))) {
final address =
await fetchUnstoppableDomainAddress(domain, ticker);