Skip to main content

PnP Flutter SDK - v5 to v6

This migration guide provides steps for upgrading from version v5 to v6 of the PnP Flutter SDK. The guide outlines significant changes and enhancements, including the support of Web3Auth OpenLogin version v9, and Wallet Services v3.

Breaking Changes

getSignResponse is now removed.

In v6, we try to improve the developer experience by removing the getSignResponse method and returning the result in the request method itself.

Previously, after calling the request method, developers had to use the getSignResponse method to retrieve the SignResponse. In the latest version v6, the request method will return the SignResponse directly.

try {
List<dynamic> params = [];
// Message to be signed
params.add("Hello, Web3Auth from Flutter!");
// User's EOA address
params.add("<User Address in Hex>");

final response = await Web3AuthFlutter.request(
ChainConfig(
chainId: "0x1",
rpcTarget: "https://mainnet.infura.io/v3/$key",
),
"personal_sign",
params,
);

final response = await Web3AuthFlutter.getSignResponse();

log(response.toString());
} on UserCancelledException {
log("User cancelled.");
} catch(e) {
log("Unknown exception occurred");
}

Minimum Android SDK Version

The minimum Android SDK version for the PnP Flutter SDK is now 26. Please update your app level gradle file to set the minimum SDK version to 26.

defaultConfig {
// ...
minSdkVersion 26 //flutter.minSdkVersion
minSdkVersion 24 //flutter.minSdkVersion
// ...
}

Enhancements

In the latest version v6, we have added support for the Web3Auth Auth Service version v9, and Wallet Services v3. In Wallet Services v3, the prebuilt wallet UI now supports the swap functionality allowing users to swap to their favorite token from the app itself.