diff --git a/docs/migration-guides/ios-v9-to-v10.mdx b/docs/migration-guides/ios-v9-to-v10.mdx new file mode 100644 index 000000000..a673c14bc --- /dev/null +++ b/docs/migration-guides/ios-v9-to-v10.mdx @@ -0,0 +1,50 @@ +--- +title: PnP iOS SDK - v9 to v10 +description: "PnP iOS SDK - v9 to v10 | Documentation - Web3Auth" +sidebar_label: v9 to v10 +--- + +This migration guide provides steps for upgrading from version v9 to v10 of the PnP iOS 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 v10, 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 v10, the `request` method will return the +`SignResponse` directly. + +```swift +// remove-next-line +try await self.web3Auth?.request( +// add-next-line +let response = try await self.web3Auth?.request( + chainConfig: ChainConfig( + chainId: "0x89", + rpcTarget: "https://polygon.llamarpc.com" + ), + method: "personal_sign", + requestParams: params +) + + +// remove-next-line +let response = try Web3Auth.getSignResponse() +if response!.success { + print(response!.result!) +} else { + print(response!.error!) +} + +``` + +## Enhancements + +In the latest version v10, we have added support for the Web3Auth OpenLogin 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. diff --git a/docs/sdk/pnp/ios/ios.mdx b/docs/sdk/pnp/ios/ios.mdx index 83a98b231..7c88c57ab 100644 --- a/docs/sdk/pnp/ios/ios.mdx +++ b/docs/sdk/pnp/ios/ios.mdx @@ -14,7 +14,7 @@ authentication flow of your choice. ### Requirements -- iOS 14 +- iOS 14+ - Xcode 12+ - Swift 5.x diff --git a/docs/sdk/pnp/ios/usage.mdx b/docs/sdk/pnp/ios/usage.mdx index 15548ce7d..8b267deb0 100644 --- a/docs/sdk/pnp/ios/usage.mdx +++ b/docs/sdk/pnp/ios/usage.mdx @@ -423,8 +423,7 @@ do { ## Request signature The `request` method facilitates the use of templated transaction screens for signing transactions. -Upon successful completion, you can retrieve the signature for the request using the -`getSignResponse` static method. +The method will return [SignResponse](#signresponse). Please check the list of [JSON RPC methods](https://docs.metamask.io/wallet/reference/json-rpc-api/), noting that the request @@ -451,7 +450,7 @@ do { params.append(address) // focus-start - try await self.web3Auth?.request( + let response = try await self.web3Auth?.request( chainConfig: ChainConfig( chainId: "11155111", rpcTarget: "https://eth-sepolia.public.blastapi.io" @@ -461,17 +460,23 @@ do { ) // focus-end - // focus-next-line - let response = try Web3Auth.getSignResponse() - - if response!.success { + if response!.success { print(response!.result!) } else { // Handle Error print(response!.error!) } + } catch { print(error.localizedDescription) // Handle error } ``` + +### SignResponse + +| Name | Description | +| --------- | ------------------------------------------------------------- | +| `success` | Determines whether the request was successful or not. | +| `result?` | Holds the signature for the request when `success` is `true`. | +| `error?` | Holds the error for the request when `success` is `false`. | diff --git a/sidebars.ts b/sidebars.ts index ad30722a2..a46e998b0 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -1363,11 +1363,12 @@ const sidebars: SidebarsConfig = { type: "category", label: "Migration Guides", items: [ - "migration-guides/ios-v6-to-v7", - "migration-guides/ios-v7-to-v8", - "migration-guides/ios-v8-to-v8.1", - "migration-guides/ios-v8.1-to-v8.2", + "migration-guides/ios-v9-to-v10", "migration-guides/ios-v8.2-to-v8.3", + "migration-guides/ios-v8.1-to-v8.2", + "migration-guides/ios-v8-to-v8.1", + "migration-guides/ios-v7-to-v8", + "migration-guides/ios-v6-to-v7", ], }, ...sdkQuickLinks, diff --git a/src/common/sdk/pnp/ios/_cocoapods.mdx b/src/common/sdk/pnp/ios/_cocoapods.mdx index d751c6449..09a2874d1 100644 --- a/src/common/sdk/pnp/ios/_cocoapods.mdx +++ b/src/common/sdk/pnp/ios/_cocoapods.mdx @@ -3,7 +3,7 @@ To install the Web3Auth SDK using Cocoapods, follow the below steps: 1. Open the Podfile, and add the Web3Auth pod: ```sh -pod 'Web3Auth', '~> 9.0.0' +pod 'Web3Auth', '~> 10.0.1' ``` 2. Once added, use `pod install` command to download the Web3Auth dependency. diff --git a/src/common/sdk/pnp/ios/_spm.mdx b/src/common/sdk/pnp/ios/_spm.mdx index a156eea5b..c1dca5e46 100644 --- a/src/common/sdk/pnp/ios/_spm.mdx +++ b/src/common/sdk/pnp/ios/_spm.mdx @@ -6,7 +6,7 @@ https://github.com/Web3Auth/web3auth-swift-sdk ``` - From the `Dependency Rule` dropdown, select `Exact Version` and enter `9.0.0` as the version. + From the `Dependency Rule` dropdown, select `Exact Version` and enter `10.0.1` as the version. 3. When finished, Xcode will automatically begin resolving and downloading your dependencies in the background. diff --git a/src/common/versions.ts b/src/common/versions.ts index fe3f45314..af1d59f9e 100644 --- a/src/common/versions.ts +++ b/src/common/versions.ts @@ -1,6 +1,6 @@ export const pnpWebVersion = `9.3.x`; export const pnpAndroidVersion = `8.0.3`; -export const pnpIOSVersion = `9.0.0`; +export const pnpIOSVersion = `10.0.1`; export const pnpRNVersion = `7.0.x`; export const pnpFlutterVersion = `5.0.4`; export const pnpUnityVersion = `5.x.x`;