diff --git a/CircleModularWalletsCore/Resources/Info.plist b/CircleModularWalletsCore/Resources/Info.plist index 8ae6d13..55bc324 100644 --- a/CircleModularWalletsCore/Resources/Info.plist +++ b/CircleModularWalletsCore/Resources/Info.plist @@ -3,7 +3,7 @@ CFBundleShortVersionString - 1.4.1 + 1.2.0 CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleName @@ -13,7 +13,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) NSHumanReadableCopyright - + CFBundleExecutable $(EXECUTABLE_NAME) CFBundleVersion diff --git a/CircleModularWalletsCore/Sources/APIs/Bundler/BundlerRpcApi.swift b/CircleModularWalletsCore/Sources/APIs/Bundler/BundlerRpcApi.swift index 46c57a7..3c07424 100644 --- a/CircleModularWalletsCore/Sources/APIs/Bundler/BundlerRpcApi.swift +++ b/CircleModularWalletsCore/Sources/APIs/Bundler/BundlerRpcApi.swift @@ -237,13 +237,12 @@ extension BundlerRpcApi { // Some Bundlers fail if nullish gas values are provided for gas estimation :') // So we will need to set a default zeroish value. let tmpUserOp = userOp.copy() - tmpUserOp.callGasLimit = tmpUserOp.callGasLimit ?? .zero - tmpUserOp.preVerificationGas = tmpUserOp.preVerificationGas ?? .zero - tmpUserOp.verificationGasLimit = tmpUserOp.verificationGasLimit ?? .zero + tmpUserOp.callGasLimit = .zero + tmpUserOp.preVerificationGas = .zero if paymaster != nil { - tmpUserOp.paymasterVerificationGasLimit = tmpUserOp.paymasterVerificationGasLimit ?? .zero - tmpUserOp.paymasterPostOpGasLimit = tmpUserOp.paymasterPostOpGasLimit ?? .zero + tmpUserOp.paymasterVerificationGasLimit = .zero + tmpUserOp.paymasterPostOpGasLimit = .zero } else { tmpUserOp.paymasterVerificationGasLimit = nil tmpUserOp.paymasterPostOpGasLimit = nil diff --git a/CircleModularWalletsCore/Sources/Accounts/Implementations/Web3swiftLocalAccount.swift b/CircleModularWalletsCore/Sources/Accounts/Implementations/Web3swiftLocalAccount.swift index d12494d..32716ef 100644 --- a/CircleModularWalletsCore/Sources/Accounts/Implementations/Web3swiftLocalAccount.swift +++ b/CircleModularWalletsCore/Sources/Accounts/Implementations/Web3swiftLocalAccount.swift @@ -57,6 +57,8 @@ class Web3swiftLocalAccount: Account { /// - Parameter privateKeyHex: The hex string representation of the private key. /// - Throws: An `BaseError` if the private key is invalid or cannot be converted to Data. convenience init(privateKeyHex: String) throws { + let privateKey: Data + guard let privateKey = HexUtils.hexToData(hex: privateKeyHex) else { throw BaseError(shortMessage: "Invalid private key hex string") } diff --git a/CircleModularWalletsCore/Sources/Chains/ArcTestnet.swift b/CircleModularWalletsCore/Sources/Chains/ArcTestnet.swift deleted file mode 100644 index fc18167..0000000 --- a/CircleModularWalletsCore/Sources/Chains/ArcTestnet.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2025, Circle Internet Group, Inc. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -public let ArcTestnet = _ArcTestnet() - -public struct _ArcTestnet: Chain { - - public let chainId: Int = 5042002 - - public let blockchain: String = "ARC-TESTNET" - -} diff --git a/CircleModularWalletsCore/Sources/Chains/Monad.swift b/CircleModularWalletsCore/Sources/Chains/Monad.swift deleted file mode 100644 index 90c4d78..0000000 --- a/CircleModularWalletsCore/Sources/Chains/Monad.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2025, Circle Internet Group, Inc. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -public let Monad = _Monad() - -public struct _Monad: Chain { - - public let chainId: Int = 143 - - public let blockchain: String = "MONAD" - -} diff --git a/CircleModularWalletsCore/Sources/Chains/MonadTestnet.swift b/CircleModularWalletsCore/Sources/Chains/MonadTestnet.swift deleted file mode 100644 index 50fdb5b..0000000 --- a/CircleModularWalletsCore/Sources/Chains/MonadTestnet.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) 2025, Circle Internet Group, Inc. All rights reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import Foundation - -public let MonadTestnet = _MonadTestnet() - -public struct _MonadTestnet: Chain { - - public let chainId: Int = 10143 - - public let blockchain: String = "MONAD-TESTNET" - -} diff --git a/CircleModularWalletsCore/Sources/Helpers/Constants.swift b/CircleModularWalletsCore/Sources/Helpers/Constants.swift index 1b2d1b0..7a35562 100644 --- a/CircleModularWalletsCore/Sources/Helpers/Constants.swift +++ b/CircleModularWalletsCore/Sources/Helpers/Constants.swift @@ -27,23 +27,20 @@ let CIRCLE_SMART_ACCOUNT_VERSION: [String: String] = [ ] let CONTRACT_ADDRESS: [String: String] = [ + PolygonToken.USDC.name: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", ArbitrumToken.USDC.name: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", ArbitrumToken.ARB.name: "0x912CE59144191C1204E64559FE8253a0e49E6548", AvalancheToken.USDC.name: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", BaseToken.USDC.name: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", - MonadToken.USDC.name: "0x754704bc059f8c67012fed69bc8a327a5aafb603", OptimismToken.USDC.name: "0x0b2c639c533813f4aa9d7837caf62653d097ff85", OptimismToken.OP.name: "0x4200000000000000000000000000000000000042", - PolygonToken.USDC.name: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359", UnichainToken.USDC.name: "0x078D782b760474a361dDA0AF3839290b0EF57AD6", + PolygonAmoyToken.USDC.name: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", ArbitrumSepoliaToken.USDC.name: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d", - ArcTestnetToken.USDC.name: "0x3600000000000000000000000000000000000000", AvalancheFujiToken.USDC.name: "0x5425890298aed601595a70ab815c96711a31bc65", BaseSepoliaToken.USDC.name: "0x036CbD53842c5426634e7929541eC2318f3dCF7e", - MonadTestnetToken.USDC.name: "0x534b2f3A21130d7a60830c2Df862319e593943A3", OptimismSepoliaToken.USDC.name: "0x5fd84259d66Cd46123540766Be93DFE6D43130D7", - PolygonAmoyToken.USDC.name: "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582", UnichainSepoliaToken.USDC.name: "0x31d0220469e10c4E71834a79b1f276d740d3768F", ] diff --git a/CircleModularWalletsCore/Sources/Helpers/Extensions/Bundle+Extension.swift b/CircleModularWalletsCore/Sources/Helpers/Extensions/Bundle+Extension.swift index 42dd741..41d1d2a 100644 --- a/CircleModularWalletsCore/Sources/Helpers/Extensions/Bundle+Extension.swift +++ b/CircleModularWalletsCore/Sources/Helpers/Extensions/Bundle+Extension.swift @@ -21,7 +21,7 @@ import Foundation #if SWIFT_PACKAGE extension Bundle { public enum SDK { - public static let version = "1.4.1" // x-release-please-version + public static let version = "1.2.0" } } #else diff --git a/CircleModularWalletsCore/Sources/Helpers/Utils/Utils.swift b/CircleModularWalletsCore/Sources/Helpers/Utils/Utils.swift index 3c666bd..8740478 100644 --- a/CircleModularWalletsCore/Sources/Helpers/Utils/Utils.swift +++ b/CircleModularWalletsCore/Sources/Helpers/Utils/Utils.swift @@ -94,7 +94,7 @@ public struct Utils { signature: String, webauthn: WebAuthnData) throws -> Bool { do { - let rawClientData = try webauthn.clientDataJSON.bytes + let rawClientData = webauthn.clientDataJSON.bytes let clientData = try JSONDecoder().decode(CollectedClientData.self, from: Data(rawClientData)) let rawAuthenticatorData = try HexUtils.hexToBytes(hex: webauthn.authenticatorData) let authenticatorData = try AuthenticatorData(bytes: rawAuthenticatorData) diff --git a/CircleModularWalletsCore/Sources/Models/Token.swift b/CircleModularWalletsCore/Sources/Models/Token.swift index 9543d23..7b2e1aa 100644 --- a/CircleModularWalletsCore/Sources/Models/Token.swift +++ b/CircleModularWalletsCore/Sources/Models/Token.swift @@ -57,18 +57,6 @@ public enum BaseToken: String { } } -public enum MonadToken: String { - case USDC - - public var chainId: Int { - return Monad.chainId - } - - public var name: String { - return "Monad_\(self.rawValue)" - } -} - public enum OptimismToken: String { case USDC case OP @@ -120,18 +108,6 @@ public enum ArbitrumSepoliaToken: String { } } -public enum ArcTestnetToken: String { - case USDC - - public var chainId: Int { - return ArcTestnet.chainId - } - - public var name: String { - return "ArcTestnet_\(self.rawValue)" - } -} - public enum AvalancheFujiToken: String { case USDC @@ -156,18 +132,6 @@ public enum BaseSepoliaToken: String { } } -public enum MonadTestnetToken: String { - case USDC - - public var chainId: Int { - return MonadTestnet.chainId - } - - public var name: String { - return "MonadTestnet_\(self.rawValue)" - } -} - public enum OptimismSepoliaToken: String { case USDC diff --git a/Package.swift b/Package.swift index 6897614..e070dd9 100644 --- a/Package.swift +++ b/Package.swift @@ -22,7 +22,7 @@ import PackageDescription let package = Package( name: "CircleModularWalletsCore", platforms: [ - .macOS("13.5"), .iOS(.v16) + .iOS(.v16) ], products: [ .library( @@ -31,7 +31,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/valpackett/SwiftCBOR.git", .upToNextMinor(from: "0.4.7")), - .package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMinor(from: "3.3.2")) + .package(url: "https://github.com/web3swift-team/web3swift.git", .upToNextMinor(from: "3.2.2")) ], targets: [ .target(