Skip to main content

Migration Guide from v8 to v8.1 for Web3Auth PnP iOS SDK

Overview

This migration guide provides steps for upgrading from version 8(v8) to version 8.1(v8.1) of the Web3Auth PnP iOS SDK. The guide outlines significant changes and enhancements, including the removal of chainConfig parameter from W3AInitParams, and addition of chainConfig parameter in launchWalletServices method.

Changes in Detail

chainConfig parameter changes

From v8.1, the chainConfig parameter is removed from W3AInitParams and added to launchWalletServices method. This change ensures, developers can open the wallet services with their choice of chain on runtime.

Before (v8)

Usage
do {
var chainConfig = ChainConfig(
chainNamespace: ChainNamespace.eip155,
chainId: "0x1",
rpcTarget: "https://mainnet.infura.io/v3/${key}",
ticker: "ETH"
)

val web3Auth = await Web3Auth(.init(
clientId: clientID,
network: network,
buildEnv: buildEnv,
chainConfig: chainConfig
))

try await web3Auth?.launchWalletServices(
W3ALoginParams(loginProvider: .GOOGLE),
)
} catch {
// Handle error
}

After (v8.1)

Usage
do {
var chainConfig = ChainConfig(
chainNamespace: ChainNamespace.eip155,
chainId: "0x1",
rpcTarget: "https://mainnet.infura.io/v3/${key}",
ticker: "ETH"
)

try await web3Auth?.launchWalletServices(
W3ALoginParams(loginProvider: .GOOGLE),
chainConfig: chainConfig
)
} catch {
// Handle error
}