-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1006 from Web3Auth/pnp-android-v9
[Android PnP] Update docs for v9
- Loading branch information
Showing
6 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: PnP Android SDK - v8 to v9 | ||
description: "PnP Android SDK - v8 to v9 | Documentation - Web3Auth" | ||
sidebar_label: v8 to v9 | ||
--- | ||
|
||
This migration guide provides steps for upgrading from version v8 to v9 of the PnP Android 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 v9, 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 v9, the `request` method will return the | ||
`SignResponse` directly. | ||
|
||
```kotlin | ||
val params = JsonArray().apply { | ||
// Message to be signed | ||
add("Hello, World!") | ||
// User's EOA address | ||
add(address) | ||
} | ||
|
||
val chainConfig = ChainConfig( | ||
chainId = "0x1", | ||
rpcTarget = "https://rpc.ankr.com/eth", | ||
ticker = "ETH", | ||
chainNamespace = ChainNamespace.EIP155 | ||
) | ||
|
||
val signMsgCompletableFuture = web3Auth.request( | ||
chainConfig = chainConfig, | ||
"personal_sign", | ||
requestParams = params | ||
) | ||
|
||
// focus-start | ||
// remove-next-line | ||
signMsgCompletableFuture.whenComplete { _, error -> | ||
// add-next-line | ||
signMsgCompletableFuture.whenComplete { signResult, error -> | ||
if (error == null) { | ||
// remove-next-line | ||
val signResult = Web3Auth.getSignResponse() | ||
Log.d("Sign Result", signResult.toString()) | ||
|
||
} else { | ||
Log.d("MainActivity_Web3Auth", error.message ?: "Something went wrong") | ||
} | ||
} | ||
// focus-end | ||
``` | ||
|
||
## Enhancements | ||
|
||
In the latest version v9, 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters