From 28e5f9d9e82da3965eac9e60c5c1f6d71855ffb9 Mon Sep 17 00:00:00 2001 From: Peter Anyaogu Date: Mon, 14 Oct 2024 21:40:15 +0100 Subject: [PATCH] test on ios --- example/ios/Flutter/AppFrameworkInfo.plist | 46 +++++++++--------- example/ios/Podfile | 2 +- example/ios/Podfile.lock | 22 ++++----- example/ios/Runner.xcodeproj/project.pbxproj | 15 ++++-- example/ios/Runner/Info.plist | 2 +- example/ios/Runner/Runner.entitlements | 10 ++++ example/lib/providers/wallet_provider.dart | 21 +++------ example/pubspec.lock | 18 +++---- lib/src/4337/userop.dart | 2 - pubspec.lock | 49 +++++++++++++------- 10 files changed, 101 insertions(+), 86 deletions(-) create mode 100644 example/ios/Runner/Runner.entitlements diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 7c56964..4d379e7 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -1,26 +1,26 @@ - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 12.0 - - + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 16.0 + + \ No newline at end of file diff --git a/example/ios/Podfile b/example/ios/Podfile index 8e41300..9e2cb6e 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '12.4' +platform :ios, '16.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1388937..659ea09 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -14,9 +14,7 @@ PODS: - Flutter - FlutterMacOS - Toast (4.1.0) - - ua_client_hints (1.2.2): - - Flutter - - web3_signers (0.0.1): + - ua_client_hints (1.4.0): - Flutter DEPENDENCIES: @@ -27,7 +25,6 @@ DEPENDENCIES: - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - ua_client_hints (from `.symlinks/plugins/ua_client_hints/ios`) - - web3_signers (from `.symlinks/plugins/web3_signers/ios`) SPEC REPOS: trunk: @@ -48,20 +45,17 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" ua_client_hints: :path: ".symlinks/plugins/ua_client_hints/ios" - web3_signers: - :path: ".symlinks/plugins/web3_signers/ios" SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef - fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 + flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778 + fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c passkeys_ios: fdae8c06e2178a9fcb9261a6cb21fb9a06a81d53 - path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c - shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 Toast: ec33c32b8688982cecc6348adeae667c1b9938da - ua_client_hints: 7f4e0f5d390685e8f7efd6eb363594f760108926 - web3_signers: 5f49d582ab0d1fe673b3220aa6ecf25bb3cbed6b + ua_client_hints: 46bb5817a868f9e397c0ba7e3f2f5c5d90c35156 -PODFILE CHECKSUM: 8e101fac9760a9fc2bf6ef04178c5d9c7f894567 +PODFILE CHECKSUM: 4c438addb11b6da45ed7ae408823d68256222460 -COCOAPODS: 1.14.2 +COCOAPODS: 1.15.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 64e1869..e5e33af 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -64,6 +64,7 @@ A7E83DBB1826CD9D3A064E3D /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; AF0E938D37BDA368A07CB299 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; CD2ADA656814A888BCA45D23 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + D01014472CBD21CE00B7645C /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; D405FD9596CCED7157430C74 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -139,6 +140,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + D01014472CBD21CE00B7645C /* Runner.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -161,7 +163,6 @@ A7E83DBB1826CD9D3A064E3D /* Pods-RunnerTests.release.xcconfig */, CD2ADA656814A888BCA45D23 /* Pods-RunnerTests.profile.xcconfig */, ); - name = Pods; path = Pods; sourceTree = ""; }; @@ -453,7 +454,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -468,7 +469,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 8WHFWN93P6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -580,7 +583,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -629,7 +632,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -646,7 +649,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 8WHFWN93P6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -668,7 +673,9 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 8WHFWN93P6; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index ec6255d..aa53b39 100644 --- a/example/ios/Runner/Info.plist +++ b/example/ios/Runner/Info.plist @@ -46,6 +46,6 @@ UIApplicationSupportsIndirectInputEvents NSFaceIDUsageDescription - Why is my app authenticating using face id? + Why is my app authenticating using face id? diff --git a/example/ios/Runner/Runner.entitlements b/example/ios/Runner/Runner.entitlements new file mode 100644 index 0000000..5547819 --- /dev/null +++ b/example/ios/Runner/Runner.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.developer.associated-domains + + webcredentials:variance.space + + + diff --git a/example/lib/providers/wallet_provider.dart b/example/lib/providers/wallet_provider.dart index c20a7c7..1923867 100644 --- a/example/lib/providers/wallet_provider.dart +++ b/example/lib/providers/wallet_provider.dart @@ -3,8 +3,7 @@ import 'dart:math' as math; import 'package:flutter/foundation.dart'; import 'package:web3_signers/web3_signers.dart'; import 'package:variance_dart/variance_dart.dart'; -import 'package:web3dart/credentials.dart'; -import 'package:web3dart/web3dart.dart' as w3d; +import 'package:web3dart/web3dart.dart'; class WalletProvider extends ChangeNotifier { final Chain _chain; @@ -38,9 +37,6 @@ class WalletProvider extends ChangeNotifier { final options = PassKeysOptions( name: "variance", namespace: "variance.space", - origin: "https://variance.space", - userVerification: "required", - requireResidentKey: true, sharedWebauthnSigner: EthereumAddress.fromHex( "0xfD90FAd33ee8b58f32c00aceEad1358e4AFC23f9")); final pkpSigner = PassKeySigner(options: options); @@ -79,11 +75,8 @@ class WalletProvider extends ChangeNotifier { } Future createPrivateKeyWallet() async { - final random = math.Random.secure(); - final privateKey = EthPrivateKey.createRandom(random); - - final signer = PrivateKeySigner.create(privateKey, "123456", random, - options: const SignatureOptions(prefix: [0])); + final signer = PrivateKeySigner.createRandom( + "password", const SignatureOptions(prefix: [0])); final SmartWalletFactory walletFactory = SmartWalletFactory(_chain, signer); try { @@ -126,18 +119,18 @@ class WalletProvider extends ChangeNotifier { Contract.encodeFunctionCall( "mint", erc20, ContractAbis.get("ERC20_Mint"), [ _wallet?.address, - w3d.EtherAmount.fromInt(w3d.EtherUnit.ether, 20).getInWei + EtherAmount.fromInt(EtherUnit.ether, 20).getInWei ]), Contract.encodeERC20TransferCall( - erc20, deployer, w3d.EtherAmount.fromInt(w3d.EtherUnit.ether, 20)) + erc20, deployer, EtherAmount.fromInt(EtherUnit.ether, 20)) ]); await tx2?.wait(); } Future sendTransaction(String recipient, String amount) async { - final etherAmount = w3d.EtherAmount.fromBigInt(w3d.EtherUnit.wei, - BigInt.from(double.parse(amount) * math.pow(10, 18))); + final etherAmount = EtherAmount.fromBigInt( + EtherUnit.wei, BigInt.from(double.parse(amount) * math.pow(10, 18))); final response = await _wallet?.send( EthereumAddress.fromHex("0xF5bB7F874D8e3f41821175c0Aa9910d30d10e193"), diff --git a/example/pubspec.lock b/example/pubspec.lock index 196b83b..9c46e8f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" fixnum: dependency: transitive description: @@ -420,10 +420,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.2.12" path_provider_foundation: dependency: transitive description: @@ -532,10 +532,10 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_foundation: dependency: transitive description: @@ -683,7 +683,7 @@ packages: path: ".." relative: true source: path - version: "0.1.4" + version: "0.1.5" vector_math: dependency: transitive description: @@ -720,10 +720,10 @@ packages: dependency: "direct main" description: name: web3_signers - sha256: cb07808a4add7119f07c5c696db242a78df0c6c45a414ff8f1333b747b811b21 + sha256: f2c4ce74ef4546108926bc9ccbdb3c45b495685cbe8b94edbb1e0db22555485b url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "0.1.7" web3dart: dependency: "direct main" description: diff --git a/lib/src/4337/userop.dart b/lib/src/4337/userop.dart index a855a35..e4a2502 100644 --- a/lib/src/4337/userop.dart +++ b/lib/src/4337/userop.dart @@ -196,8 +196,6 @@ class UserOperation implements UserOperationBase { [encoded, chain.entrypoint.address, BigInt.from(chain.chainId)])); } - /// uses pimlico v07 useroperation standard, which requires only pimlico bundlers - /// this is a training wheel and will revert to which ever schema bundlers accept in concensus @override Map packUserOperation() { Map op = { diff --git a/pubspec.lock b/pubspec.lock index 09cce85..f90e0c2 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.7.0" args: dependency: transitive description: @@ -93,18 +98,18 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "644dc98a0f179b872f612d3eb627924b578897c629788e858157fa5e704ca0c7" + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" url: "https://pub.dev" source: hosted - version: "2.4.11" + version: "2.4.13" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 url: "https://pub.dev" source: hosted - version: "7.3.1" + version: "7.3.2" built_collection: dependency: transitive description: @@ -173,10 +178,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.3.7" eip1559: dependency: "direct main" description: @@ -197,10 +202,10 @@ packages: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" fixnum: dependency: transitive description: @@ -323,6 +328,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -351,10 +364,10 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" mockito: dependency: "direct dev" description: @@ -556,10 +569,10 @@ packages: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.3" timing: dependency: transitive description: @@ -628,10 +641,10 @@ packages: dependency: "direct main" description: name: web3_signers - sha256: cb07808a4add7119f07c5c696db242a78df0c6c45a414ff8f1333b747b811b21 + sha256: f2c4ce74ef4546108926bc9ccbdb3c45b495685cbe8b94edbb1e0db22555485b url: "https://pub.dev" source: hosted - version: "0.1.6" + version: "0.1.7" web3dart: dependency: "direct main" description: