Connect to Blocto wallet
Make sure you initialize Blocto SDK first
Before you start to interact with Blocto wallet, you need to have wallet connected.
Once the wallet connection requested, it would
  • redirect to the Blocto wallet app if it is installed.
  • open Blocto web SDK using ASWebAuthenticationSession if the Blocto Wallet app is not installed.
and ask user to connect the wallet.
BloctoSDK.shared.ethereum.requestAccount { [weak self] result in
switch result {
case .success(let address):
// handle address here
case .failure(let error):
// handle error here
}
}
BloctoSDK.shared.bsc.requestAccount { [weak self] result in
switch result {
case .success(let address):
// handle address here
case .failure(let error):
// handle error here
}
}
BloctoSDK.shared.polygon.requestAccount { [weak self] result in
switch result {
case .success(let address):
// handle address here
case .failure(let error):
// handle error here
}
}
BloctoSDK.shared.avalanche.requestAccount { [weak self] result in
switch result {
case .success(let address):
// handle address here
case .failure(let error):
// handle error here
}
}
Copy link