Skip to content

Commit

Permalink
test on ios
Browse files Browse the repository at this point in the history
  • Loading branch information
code-z2 committed Oct 14, 2024
1 parent a7b77f2 commit 28e5f9d
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 86 deletions.
46 changes: 23 additions & 23 deletions example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>12.0</string>
</dict>
</plist>
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>16.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
22 changes: 8 additions & 14 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
15 changes: 11 additions & 4 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
D01014472CBD21CE00B7645C /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -139,6 +140,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
D01014472CBD21CE00B7645C /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
Expand All @@ -161,7 +163,6 @@
A7E83DBB1826CD9D3A064E3D /* Pods-RunnerTests.release.xcconfig */,
CD2ADA656814A888BCA45D23 /* Pods-RunnerTests.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -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;
Expand All @@ -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 = (
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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 = (
Expand All @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string>
<string>Why is my app authenticating using face id?</string>
</dict>
</plist>
10 changes: 10 additions & 0 deletions example/ios/Runner/Runner.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>webcredentials:variance.space</string>
</array>
</dict>
</plist>
21 changes: 7 additions & 14 deletions example/lib/providers/wallet_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -79,11 +75,8 @@ class WalletProvider extends ChangeNotifier {
}

Future<void> 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 {
Expand Down Expand Up @@ -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<void> 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"),
Expand Down
18 changes: 9 additions & 9 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -683,7 +683,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.4"
version: "0.1.5"
vector_math:
dependency: transitive
description:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions lib/src/4337/userop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> packUserOperation() {
Map<String, String> op = {
Expand Down
Loading

0 comments on commit 28e5f9d

Please sign in to comment.