Skip to main content
Version: 3.0.0

Establishing a connection

A connection to Coinbase Wallet can be initiated by calling the initiateHandshake function provided by the SDK. The function also takes in an optional initialActions parameter which apps can use to take certain actions along with the initial handshake request.

private let cbwallet = CoinbaseWalletSDK.shared

initialActions: [
Action(jsonRpc: .eth_requestAccounts)
) { result, account in
switch result {
case .success(let response):
self.logObject(label: "Response:\n", response)

guard let account = account else { return }
self.logObject(label: "Account:\n", account)
self.address = account.address
case .failure(let error):

An example handshake request is provided in our sample application.

Was this helpful?