Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mobile PnP Docs #1051

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docs/sdk/pnp/android/android.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ generated in a non-custodial way on successful user authentication. This authent
achieved by using any social login options that Web3Auth supports or custom authentication flow of
your choice.

## Requirements

- Android API version `24` or newer.
- Android Compile and Target SDK: `34`.
- Basic knowledge of Java or Kotlin Development.

## Resources

- [Quick Start](/quick-start?product=PNP&sdk=PNP_ANDROID&framework=ANDROID&stepIndex=0): Get Started
Expand Down
6 changes: 6 additions & 0 deletions docs/sdk/pnp/android/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ import Whitelist from "@site/src/common/sdk/pnp/android/_android-whitelist.mdx";
import Deeplinking from "@site/src/common/sdk/pnp/android/_android-deep-linking.mdx";
import ManifestChanges from "@site/src/common/sdk/pnp/android/_android-manifest-changes.mdx";

## Requirements

- Android API version `24` or newer.
- Android Compile and Target SDK: `34`.
- Basic knowledge of Java or Kotlin Development.

## Installation

<UpdateGradle />
Expand Down
30 changes: 26 additions & 4 deletions docs/sdk/pnp/android/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ import EnableMFAMethod from "@site/src/common/sdk/pnp/android/_enable-mfa.mdx";
Web3Auth's Android SDK is a set of libraries and tools that allow you to easily integrate Web3 with
Android applications.

## Functionality Overview

| Name | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [login](#logging-in-a-user) | Logs in the user with the selected login provider. |
| [logout](#logging-out-a-user) | Logs out the user from the currently active session. |
| [getPrivKey](#secp256k1-private-key) | Retrieve the user's secp256K1 key. The key can be used to sign transactions for chains using the secp256k1 curve like EVM-compatible chains. |
| [getEd25519PrivKey](#ed25519-private-key) | Retrieve the user's ed25519 key. The key can be used to sign transactions for chains using the ed25519 curve like Solana, Near, Algorand, and others. |
| [getUserInfo](#retrieve-user-information) | Retrieve the user information, such as login provider, name, email, oAuth token, etc. |
| [enableMFA](#enable-mfa-for-a-user) | Use to trigger the setup MFA flow for the users. |
| [launchWalletServices](#launch-wallet-services) | Use to open the templated wallet UI in WebView. |
| [request](#request-signature) | Use to open templated transaction screens for signing EVM transactions. |

## Logging in a User

To login in a user, you can use the `login` method. It will trigger login flow will navigate the
Expand Down Expand Up @@ -336,13 +349,14 @@ val privateKey = web3Auth.getPrivKey()
### Ed25519 Private Key

To retrieve the secp256k1 private key of the user., use `getEd25519PrivKey` method. This private key
can be used to sign transactions on Solana.
can be used to sign transactions on Solana, Near, Algorand, and other chains that use the ed25519
curve.

```kotlin
val privateKey = web3Auth.getEd25519PrivKey()
```

## Retrive User Information
## Retrieve User Information

You can use the `getUserInfo` method to retrieve various details about the user, such as their login
type, whether multi-factor authentication (MFA) is enabled, profile image, name, and other relevant
Expand Down Expand Up @@ -472,8 +486,8 @@ val completableFuture = web3Auth.launchWalletServices(
## 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). It can be used to sign transactions for any
EVM chain and screens can be whitelabeled to your branding.

Please check the list of
[JSON RPC methods](https://docs.metamask.io/wallet/reference/json-rpc-api/), noting that the request
Expand Down Expand Up @@ -524,3 +538,11 @@ signMsgCompletableFuture.whenComplete { signResult, 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`. |
5 changes: 0 additions & 5 deletions docs/sdk/pnp/flutter/flutter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ It returns a private key generated in a non-custodial way on successful user aut
authentication is achieved by using any of the supported social logins Web3Auth provides or using a
custom authentication flow of your choice.

## Requirements

- **Android** API version 26 or newer.
- **iOS** 14, Xcode 12+ and Swift 5.x

## Resources

- [Quick Start](/quick-start?product=PNP&sdk=PNP_FLUTTER&framework=ANDROID&stepIndex=1&stepIndex=0):
Expand Down
5 changes: 5 additions & 0 deletions docs/sdk/pnp/flutter/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import SPM from "@site/src/common/sdk/pnp/ios/_spm.mdx";
import Cocoapods from "@site/src/common/sdk/pnp/ios/_cocoapods.mdx";
import IOSWhitelist from "@site/src/common/sdk/pnp/ios/ios-whitelist.mdx";

## Requirements

- **Android** API version 26 or newer.
- **iOS** 14, Xcode 12+ and Swift 5.x

## Installation

<FlutterInstallation />
Expand Down
30 changes: 26 additions & 4 deletions docs/sdk/pnp/flutter/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ import FlutterResponse from "@site/src/common/sdk/pnp/_userinfo_response.mdx";
import SMSPasswordless from "@site/src/common/sdk/pnp/flutter/_sms_passwordless.mdx";
import EnableMFAMethod from "@site/src/common/sdk/pnp/flutter/_enable-mfa.mdx";

## Functionality Overview

| Name | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [login](#logging-in-a-user) | Logs in the user with the selected login provider. |
| [logout](#logging-out-a-user) | Logs out the user from the currently active session. |
| [getPrivKey](#secp256k1-private-key) | Retrieve the user's secp256K1 key. The key can be used to sign transactions for chains using the secp256k1 curve like EVM-compatible chains. |
| [getEd25519PrivKey](#ed25519-private-key) | Retrieve the user's ed25519 key. The key can be used to sign transactions for chains using the ed25519 curve like Solana, Near, Algorand, and others. |
| [getUserInfo](#retrieve-user-information) | Retrieve the user information, such as login provider, name, email, oAuth token, etc. |
| [enableMFA](#enable-mfa-for-a-user) | Use to trigger the setup MFA flow for the users. |
| [launchWalletServices](#launch-wallet-services) | Use to open the templated wallet UI in WebView. |
| [request](#request-signature) | Use to open templated transaction screens for signing EVM transactions. |

## Logging in a User

To login in a user, you can use the `login` method. It will trigger login flow will navigate the
Expand Down Expand Up @@ -410,13 +423,14 @@ final privateKey = await Web3AuthFlutter.getPrivKey();
### Ed25519 Private Key

To retrieve the secp256k1 private key of the user., use `getEd25519PrivKey` method. This private key
can be used to sign transactions on Solana.
can be used to sign transactions on Solana, Near, Algorand, and other chains that use the ed25519
curve.

```dart
final privateKey = await Web3AuthFlutter.getEd25519PrivKey();
```

## Retrive User Information
## Retrieve User Information

You can use the `getUserInfo` method to retrieve various details about the user, such as their login
type, whether multi-factor authentication (MFA) is enabled, profile image, name, and other relevant
Expand Down Expand Up @@ -586,8 +600,8 @@ try {
## 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). It can be used to sign transactions for any
EVM chain and screens can be whitelabeled to your branding.

Please check the list of
[JSON RPC methods](https://docs.metamask.io/wallet/reference/json-rpc-api/), noting that the request
Expand Down Expand Up @@ -632,3 +646,11 @@ try {
log("Unknown exception occurred");
}
```

### 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`. |
6 changes: 6 additions & 0 deletions docs/sdk/pnp/ios/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import SPM from "@site/src/common/sdk/pnp/ios/_spm.mdx";
import Cocoapods from "@site/src/common/sdk/pnp/ios/_cocoapods.mdx";
import Whitelist from "@site/src/common/sdk/pnp/ios/ios-whitelist.mdx";

## Requirements

- iOS 14+
- Xcode 12+
- Swift 5.x

## Swift Package Manager

<SPM />
Expand Down
6 changes: 0 additions & 6 deletions docs/sdk/pnp/ios/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ a private key generated in a non custodial way on successful authentication of t
authentication can be achieved by using any of the social logins Web3Auth provides or using a custom
authentication flow of your choice.

### Requirements

- iOS 14+
- Xcode 12+
- Swift 5.x

## Resources

- [Quick Start](/quick-start?product=PNP&sdk=PNP_IOS&framework=IOS&stepIndex=0): Get Started with an
Expand Down
21 changes: 18 additions & 3 deletions docs/sdk/pnp/ios/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ import Tabs from "@theme/Tabs";
import SMSPasswordless from "@site/src/common/sdk/pnp/ios/_sms_passwordless.mdx";
import EnableMFAMethod from "@site/src/common/sdk/pnp/ios/_enable-mfa.mdx";

## Functionality Overview

| Name | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [login](#logging-in-a-user) | Logs in the user with the selected login provider. |
| [logout](#logging-out-a-user) | Logs out the user from the currently active session. |
| [getPrivKey](#secp256k1-private-key) | Retrieve the user's secp256K1 key. The key can be used to sign transactions for chains using the secp256k1 curve like EVM-compatible chains. |
| [getEd25519PrivKey](#ed25519-private-key) | Retrieve the user's ed25519 key. The key can be used to sign transactions for chains using the ed25519 curve like Solana, Near, Algorand, and others. |
| [getUserInfo](#retrieve-user-information) | Retrieve the user information, such as login provider, name, email, oAuth token, etc. |
| [enableMFA](#enable-mfa-for-a-user) | Use to trigger the setup MFA flow for the users. |
| [launchWalletServices](#launch-wallet-services) | Use to open the templated wallet UI in WebView. |
| [request](#request-signature) | Use to open templated transaction screens for signing EVM transactions. |

## Logging in a User

To login in a user, you can use the `login` method. It will trigger login flow will navigate the
Expand Down Expand Up @@ -281,13 +294,14 @@ let privateKey = web3Auth.getPrivKey();
### Ed25519 Private Key

To retrieve the secp256k1 private key of the user., use `getEd25519PrivKey` method. This private key
can be used to sign transactions on Solana.
can be used to sign transactions on Solana, Near, Algorand, and other chains that use the ed25519
curve.

```swift
let privateKey = web3Auth.getEd25519PrivKey();
```

## Retrive User Information
## Retrieve User Information

You can use the `getUserInfo` method to retrieve various details about the user, such as their login
type, whether multi-factor authentication (MFA) is enabled, profile image, name, and other relevant
Expand Down Expand Up @@ -423,7 +437,8 @@ do {
## Request signature

The `request` method facilitates the use of templated transaction screens for signing transactions.
The method will return [SignResponse](#signresponse).
The method will return [SignResponse](#signresponse). It can be used to sign transactions for any
EVM chain and screens can be whitelabeled to your branding.

Please check the list of
[JSON RPC methods](https://docs.metamask.io/wallet/reference/json-rpc-api/), noting that the request
Expand Down