|
| 1 | +--- |
| 2 | +title: PnP iOS SDK - v9 to v10 |
| 3 | +description: "PnP iOS SDK - v9 to v10 | Documentation - Web3Auth" |
| 4 | +sidebar_label: v9 to v10 |
| 5 | +--- |
| 6 | + |
| 7 | +This migration guide provides steps for upgrading from version v9 to v10 of the PnP iOS SDK. The |
| 8 | +guide outlines significant changes and enhancements, including the support of Web3Auth OpenLogin |
| 9 | +version v9, and Wallet Services v3. |
| 10 | + |
| 11 | +## Breaking Changes |
| 12 | + |
| 13 | +### `getSignResponse` is now removed. |
| 14 | + |
| 15 | +In v10, we try to improve the developer experience by removing the `getSignResponse` method and |
| 16 | +returning the result in the `request` method itself. |
| 17 | + |
| 18 | +Previously, after calling the `request` method, developers had to use the `getSignResponse` method |
| 19 | +to retrieve the `SignResponse`. In the latest version v10, the `request` method will return the |
| 20 | +`SignResponse` directly. |
| 21 | + |
| 22 | +```swift |
| 23 | +// remove-next-line |
| 24 | +try await self.web3Auth?.request( |
| 25 | +// add-next-line |
| 26 | +let response = try await self.web3Auth?.request( |
| 27 | + chainConfig: ChainConfig( |
| 28 | + chainId: "0x89", |
| 29 | + rpcTarget: "https://polygon.llamarpc.com" |
| 30 | + ), |
| 31 | + method: "personal_sign", |
| 32 | + requestParams: params |
| 33 | +) |
| 34 | + |
| 35 | + |
| 36 | +// remove-next-line |
| 37 | +let response = try Web3Auth.getSignResponse() |
| 38 | +if response!.success { |
| 39 | + print(response!.result!) |
| 40 | +} else { |
| 41 | + print(response!.error!) |
| 42 | +} |
| 43 | + |
| 44 | +``` |
| 45 | + |
| 46 | +## Enhancements |
| 47 | + |
| 48 | +In the latest version v10, we have added support for the Web3Auth Auth Service version v9, and |
| 49 | +Wallet Services v3. In Wallet Services v3, the prebuilt wallet UI now supports the swap |
| 50 | +functionality allowing users to swap to their favorite token from the app itself. |
0 commit comments