Skip to content
Merged
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
33 changes: 21 additions & 12 deletions ios/dydx/dydx.xcworkspace/xcshareddata/swiftpm/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 21 additions & 63 deletions ios/dydx/dydxCartera/dydxCartera.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@
02446C5D2EA6983C00AF6FF5 /* Web3 in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C5C2EA6983C00AF6FF5 /* Web3 */; };
02446C602EA6988900AF6FF5 /* TweetNacl in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C5F2EA6988900AF6FF5 /* TweetNacl */; };
02446C632EA699BB00AF6FF5 /* SolanaSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C622EA699BB00AF6FF5 /* SolanaSwift */; };
02446C662EA69A5600AF6FF5 /* WalletConnect in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C652EA69A5600AF6FF5 /* WalletConnect */; };
02446C682EA69A5600AF6FF5 /* WalletConnectIdentity in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C672EA69A5600AF6FF5 /* WalletConnectIdentity */; };
02446C6A2EA69A5600AF6FF5 /* WalletConnectModal in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C692EA69A5600AF6FF5 /* WalletConnectModal */; };
02446C6C2EA69A5600AF6FF5 /* WalletConnectNetworking in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C6B2EA69A5600AF6FF5 /* WalletConnectNetworking */; };
02446C6E2EA69A5600AF6FF5 /* WalletConnectNotify in Frameworks */ = {isa = PBXBuildFile; productRef = 02446C6D2EA69A5600AF6FF5 /* WalletConnectNotify */; };
02446C792EA6CA8B00AF6FF5 /* SolanaSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 02886C762D84B766005EF461 /* SolanaSwift */; };
02446E5B2EA6E11600AF6FF5 /* ReownAppKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02446E5A2EA6E11600AF6FF5 /* ReownAppKit */; };
02446E5D2EA6E11600AF6FF5 /* WalletConnect in Frameworks */ = {isa = PBXBuildFile; productRef = 02446E5C2EA6E11600AF6FF5 /* WalletConnect */; };
0274248429E74CA5004C89AE /* Parser+Eth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0274248329E74CA5004C89AE /* Parser+Eth.swift */; };
0274248729E76718004C89AE /* EthConversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0274248629E76718004C89AE /* EthConversions.swift */; };
0274248929E78576004C89AE /* ERC20Token.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0274248829E78576004C89AE /* ERC20Token.swift */; };
Expand Down Expand Up @@ -255,22 +253,20 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
02446E5D2EA6E11600AF6FF5 /* WalletConnect in Frameworks */,
02446C792EA6CA8B00AF6FF5 /* SolanaSwift in Frameworks */,
02446C5A2EA697FB00AF6FF5 /* CoinbaseWalletSDK in Frameworks */,
02446C602EA6988900AF6FF5 /* TweetNacl in Frameworks */,
02446C682EA69A5600AF6FF5 /* WalletConnectIdentity in Frameworks */,
023F7F0D2AD09732006CC4CD /* ParticlesKit.framework in Frameworks */,
023F7F082AD09725006CC4CD /* Utilities.framework in Frameworks */,
380B90E0F0184BA5387AC70A /* Pods_iOS_dydxCartera.framework in Frameworks */,
0294C8912D7930EB00F62FB5 /* Base58Swift in Frameworks */,
02446E5B2EA6E11600AF6FF5 /* ReownAppKit in Frameworks */,
02844D7D2DC187EF006F51CE /* Privy in Frameworks */,
02446C6A2EA69A5600AF6FF5 /* WalletConnectModal in Frameworks */,
02446C4D2EA6974E00AF6FF5 /* Starscream in Frameworks */,
02446C662EA69A5600AF6FF5 /* WalletConnect in Frameworks */,
02446C632EA699BB00AF6FF5 /* SolanaSwift in Frameworks */,
02446C5D2EA6983C00AF6FF5 /* Web3 in Frameworks */,
02446C502EA6976400AF6FF5 /* CryptoSwift in Frameworks */,
02446C6C2EA69A5600AF6FF5 /* WalletConnectNetworking in Frameworks */,
02446C6E2EA69A5600AF6FF5 /* WalletConnectNotify in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -621,11 +617,8 @@
02446C5C2EA6983C00AF6FF5 /* Web3 */,
02446C5F2EA6988900AF6FF5 /* TweetNacl */,
02446C622EA699BB00AF6FF5 /* SolanaSwift */,
02446C652EA69A5600AF6FF5 /* WalletConnect */,
02446C672EA69A5600AF6FF5 /* WalletConnectIdentity */,
02446C692EA69A5600AF6FF5 /* WalletConnectModal */,
02446C6B2EA69A5600AF6FF5 /* WalletConnectNetworking */,
02446C6D2EA69A5600AF6FF5 /* WalletConnectNotify */,
02446E5A2EA6E11600AF6FF5 /* ReownAppKit */,
02446E5C2EA6E11600AF6FF5 /* WalletConnect */,
);
productName = dydxCartera;
productReference = 02439C8B29B03E8A00A083FE /* dydxCartera.framework */;
Expand Down Expand Up @@ -686,7 +679,7 @@
02446C5B2EA6983C00AF6FF5 /* XCRemoteSwiftPackageReference "Web3" */,
02446C5E2EA6988800AF6FF5 /* XCRemoteSwiftPackageReference "tweetnacl-swiftwrap" */,
02446C612EA699BB00AF6FF5 /* XCRemoteSwiftPackageReference "solana-swift" */,
02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */,
02446E592EA6E11600AF6FF5 /* XCRemoteSwiftPackageReference "reown-swift" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 02439C8C29B03E8A00A083FE /* Products */;
Expand Down Expand Up @@ -1266,8 +1259,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/coinbase/wallet-mobile-sdk";
requirement = {
branch = 1.0.5;
kind = branch;
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
02446C5B2EA6983C00AF6FF5 /* XCRemoteSwiftPackageReference "Web3" */ = {
Expand All @@ -1294,12 +1287,12 @@
kind = branch;
};
};
02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */ = {
02446E592EA6E11600AF6FF5 /* XCRemoteSwiftPackageReference "reown-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/dydxprotocol/WalletConnectSwiftV2.git";
repositoryURL = "https://github.com/reown-com/reown-swift";
requirement = {
branch = develop;
kind = branch;
kind = upToNextMajorVersion;
minimumVersion = 1.7.3;
};
};
02844D7B2DC187EF006F51CE /* XCRemoteSwiftPackageReference "privy-ios" */ = {
Expand Down Expand Up @@ -1351,34 +1344,15 @@
package = 02446C612EA699BB00AF6FF5 /* XCRemoteSwiftPackageReference "solana-swift" */;
productName = SolanaSwift;
};
02446C652EA69A5600AF6FF5 /* WalletConnect */ = {
isa = XCSwiftPackageProductDependency;
package = 02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnect;
};
02446C672EA69A5600AF6FF5 /* WalletConnectIdentity */ = {
isa = XCSwiftPackageProductDependency;
package = 02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectIdentity;
};
02446C692EA69A5600AF6FF5 /* WalletConnectModal */ = {
isa = XCSwiftPackageProductDependency;
package = 02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectModal;
};
02446C6B2EA69A5600AF6FF5 /* WalletConnectNetworking */ = {
02446E5A2EA6E11600AF6FF5 /* ReownAppKit */ = {
isa = XCSwiftPackageProductDependency;
package = 02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectNetworking;
package = 02446E592EA6E11600AF6FF5 /* XCRemoteSwiftPackageReference "reown-swift" */;
productName = ReownAppKit;
};
02446C6D2EA69A5600AF6FF5 /* WalletConnectNotify */ = {
02446E5C2EA6E11600AF6FF5 /* WalletConnect */ = {
isa = XCSwiftPackageProductDependency;
package = 02446C642EA69A5600AF6FF5 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */;
productName = WalletConnectNotify;
};
02669B922AD872A300A756AA /* Cartera */ = {
isa = XCSwiftPackageProductDependency;
productName = Cartera;
package = 02446E592EA6E11600AF6FF5 /* XCRemoteSwiftPackageReference "reown-swift" */;
productName = WalletConnect;
};
02844D7C2DC187EF006F51CE /* Privy */ = {
isa = XCSwiftPackageProductDependency;
Expand All @@ -1389,27 +1363,11 @@
isa = XCSwiftPackageProductDependency;
productName = SolanaSwift;
};
0294C5FF2D790BD900F62FB5 /* Cartera */ = {
isa = XCSwiftPackageProductDependency;
productName = Cartera;
};
0294C6022D790C3C00F62FB5 /* Cartera */ = {
isa = XCSwiftPackageProductDependency;
productName = Cartera;
};
0294C8902D7930EB00F62FB5 /* Base58Swift */ = {
isa = XCSwiftPackageProductDependency;
package = 0294C88F2D7930EB00F62FB5 /* XCRemoteSwiftPackageReference "Base58Swift" */;
productName = Base58Swift;
};
029E51A22D08966E005D4DC5 /* Cartera */ = {
isa = XCSwiftPackageProductDependency;
productName = Cartera;
};
02A50EE02E3424E20086ED2C /* Cartera */ = {
isa = XCSwiftPackageProductDependency;
productName = Cartera;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 02439C8229B03E8A00A083FE /* Project object */;
Expand Down
12 changes: 8 additions & 4 deletions ios/dydx/dydxCartera/dydxCartera/Cartera/CarteraConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import Foundation
import CoinbaseWalletSDK
import UIKit
import WalletConnectSign
import WalletConnectModal
import ReownAppKit
import Utilities

public enum WalletConnectionType: Hashable {
Expand Down Expand Up @@ -183,12 +182,17 @@ public struct CarteraConfig: SingletonProtocol {

Sign.configure(crypto: DefaultCryptoProvider())

WalletConnectModal.configure(
AppKit.configure(
projectId: walletConnectV2Config.projectId,
metadata: metadata,
crypto: DefaultCryptoProvider(),
authRequestParams: nil,
includeWebWallets: false,
recommendedWalletIds: wcModalWallets,
includedWalletIds: wcModalWallets,
excludedWalletIds: [
]
],
coinbaseEnabled: false // we manage Coinbase ourselves
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Sam-dYdX It could be worthwhile to migrate our Coinbase wallet integration to Reown as well at some point.

)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation
import Starscream
import WalletConnectRelay
import ReownAppKit

extension Starscream.WebSocket: @retroactive WebSocketConnecting { }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import Web3
import CryptoSwift
import WalletConnectSigner
import ReownAppKit

struct DefaultCryptoProvider: CryptoProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

import BigInt
import CryptoKit
import WalletConnectSign
import UIKit
import Combine
import WalletConnectModal
import Utilities
@preconcurrency import ReownAppKit

final class WalletConnectV2Provider: NSObject, WalletOperationProviderProtocol {
private var backgroundTaskId: UIBackgroundTaskIdentifier = .invalid
Expand Down Expand Up @@ -114,7 +113,7 @@ final class WalletConnectV2Provider: NSObject, WalletOperationProviderProtocol {
connectCompletions.append(completion)

if request.useModal {
WalletConnectModal.present()
AppKit.present()
}
}

Expand Down Expand Up @@ -187,7 +186,7 @@ final class WalletConnectV2Provider: NSObject, WalletOperationProviderProtocol {
if success {
self?.reallySign(typedDataProvider: typedDataProvider,
accountAddress: request.address,
chainId: request.chainId) { [weak self] signed, error in
Copy link
Contributor

@Sam-dYdX Sam-dYdX Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious what was the reason to remove the [weak self]? Is it because we want this to run even if there isn't a reference to self anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The block doesn't reference to self, so no need to do weak self to avoid retain cycle.

chainId: request.chainId) { signed, error in
LocalAuthenticator.shared?.paused = false
completion(signed, error)
}
Expand Down Expand Up @@ -223,7 +222,7 @@ final class WalletConnectV2Provider: NSObject, WalletOperationProviderProtocol {
if success {
self?.reallySend(transaction: transaction,
accountAddress: request.walletRequest.address,
chainId: request.walletRequest.chainId) { [weak self] response, error in
chainId: request.walletRequest.chainId) { response, error in
LocalAuthenticator.shared?.paused = false
completion(response, error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ private extension Action {
maxFeePerGas: nil,
maxPriorityFeePerGas: nil,
gasLimit: nil,
chainId: chainIdText)
chainId: chainIdText,
actionSource: nil)
)
} else {
return nil
Expand Down
Loading