Skip to content

Commit e87e4e0

Browse files
update docs for flutter release
1 parent b775177 commit e87e4e0

7 files changed

Lines changed: 50 additions & 44 deletions

File tree

docs/sdk/pnp/android/usage.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,20 +584,21 @@ data class ChainConfig(
584584
</TabItem>
585585
</Tabs>
586586

587-
```kotlin title="Usage"
587+
### Usage
588588

589-
// highlight-start
589+
```kotlin title="Usage"
590590
val chainConfig = ChainConfig(
591591
chainId = "0x1",
592592
rpcTarget = "https://rpc.ankr.com/eth",
593593
ticker = "ETH",
594594
chainNamespace = ChainNamespace.EIP155
595595
)
596-
// highlight-end
597596

597+
// highlight-start
598598
val completableFuture = web3Auth.launchWalletServices(
599599
chainConfig
600600
)
601+
// highlight-end
601602

602603
completableFuture.whenComplete{_, error ->
603604
if(error == null) {
@@ -630,7 +631,6 @@ that the request method currently supports only the signing methods.
630631
### Usage
631632

632633
```kotlin title="Usage"
633-
634634
val params = JsonArray().apply {
635635
// Message to be signed
636636
add("Hello, World!")
@@ -645,15 +645,18 @@ val chainConfig = ChainConfig(
645645
chainNamespace = ChainNamespace.EIP155
646646
)
647647

648+
// highlight-start
648649
val signMsgCompletableFuture = web3Auth.request(
649650
chainConfig = chainConfig,
650651
"personal_sign",
651652
requestParams = params
652653
)
654+
// highlight-end
653655

654656
signMsgCompletableFuture.whenComplete { _, error ->
655657
if (error == null) {
656658
Log.d("MainActivity_Web3Auth", "Message signed successfully")
659+
// highlight-next-line
657660
val signResult = Web3Auth.getSignResponse()
658661
Log.d("MainActivity_Web3Auth", signResult.toString())
659662

docs/sdk/pnp/flutter/flutter.mdx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ sidebar_label: Overview
66
description: "Web3Auth PnP Flutter SDK | Documentation - Web3Auth"
77
---
88

9-
Web3Auth provides a [Flutter SDK](https://github.com/Web3Auth/web3auth-flutter-sdk) written in Dart. It is a client-side library you can use with your
10-
Flutter app to authenticate users using Web3Auth. It returns a private key generated in a non-custodial way on successful user authentication. This
11-
authentication is achieved by using any of the supported social logins Web3Auth provides or using a custom authentication flow of your choice.
9+
Web3Auth provides a [Flutter SDK](https://github.com/Web3Auth/web3auth-flutter-sdk) written in Dart.
10+
It is a client-side library you can use with your Flutter app to authenticate users using Web3Auth.
11+
It returns a private key generated in a non-custodial way on successful user authentication. This
12+
authentication is achieved by using any of the supported social logins Web3Auth provides or using a
13+
custom authentication flow of your choice.
1214

13-
#### This Documentation is based on the `3.1.7` SDK Version.
15+
#### This Documentation is based on the `4.0.0` SDK Version.
1416

1517
## Requirements
1618

@@ -19,14 +21,16 @@ authentication is achieved by using any of the supported social logins Web3Auth
1921

2022
## Resources
2123

22-
- [Quick Start](/quick-start?product=PNP&sdk=PNP_FLUTTER&framework=ANDROID&stepIndex=1&stepIndex=0): Get Started with an easy to follow integration of
23-
Web3Auth
24+
- [Quick Start](/quick-start?product=PNP&sdk=PNP_FLUTTER&framework=ANDROID&stepIndex=1&stepIndex=0):
25+
Get Started with an easy to follow integration of Web3Auth
2426

25-
- [Example Applications](/examples?product=Plug+and+Play&sdk=Plug+and+Play+Flutter+SDK): Explore our example applications and try the SDK yourself.
27+
- [Example Applications](/examples?product=Plug+and+Play&sdk=Plug+and+Play+Flutter+SDK): Explore our
28+
example applications and try the SDK yourself.
2629

2730
- [Troubleshooting](/troubleshooting): Find quick solutions to common issues faced by developers.
2831

29-
- [Source Code](https://github.com/Web3Auth/web3auth-flutter-sdk/): Web3Auth is open sourced. You can find the source code on our GitHub repository.
32+
- [Source Code](https://github.com/Web3Auth/web3auth-flutter-sdk/): Web3Auth is open sourced. You
33+
can find the source code on our GitHub repository.
3034

31-
- [Community Support Portal](https://web3auth.io/community/c/help-pnp/pnp-flutter/18): Join our community to get support from our team and other
32-
developers.
35+
- [Community Support Portal](https://web3auth.io/community/c/help-pnp/pnp-flutter/18): Join our
36+
community to get support from our team and other developers.

docs/sdk/pnp/flutter/install.mdx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,6 @@ Once we have configured the Android SDK, we also need add the configuration for
5959

6060
<IOSPlatform />
6161

62-
### Add dependencies
63-
64-
In order to build iOS for Web3Auth project, we also need to add the Web3Auth SDK in iOS. You can
65-
either add it using Swift Package Manager or Cocoapods.
66-
67-
#### Swift Package Manager
68-
69-
<SPM />
70-
71-
#### Cocoapods
72-
73-
<Cocoapods />
74-
7562
### Configuration
7663

7764
<IOSWhitelist />

docs/sdk/pnp/flutter/usage.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ pass `LoginParams`. If you are using custom jwt verifiers, you need to pass the
462462

463463
```dart title="Usage"
464464
try {
465+
// highlight-next-line
465466
await Web3AuthFlutter.enableMFA();
466467
} on UserCancelledException {
467468
log("User cancelled.");
@@ -557,14 +558,18 @@ class ChainConfig {
557558
</TabItem>
558559
</Tabs>
559560

561+
### Usage
562+
560563
```dart title="Usage"
561564
try {
565+
// highlight-start
562566
await Web3AuthFlutter.launchWalletServices(
563567
ChainConfig(
564568
chainId: "0x1",
565569
rpcTarget: "https://mainnet.infura.io/v3/$key",
566570
),
567571
);
572+
// highlight-end
568573
} on UserCancelledException {
569574
log("User cancelled.");
570575
} catch(e) {
@@ -585,6 +590,7 @@ that the request method currently supports only the signing methods.
585590

586591
| Arguments | Description |
587592
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
593+
| `chainConfig` | Defines the chain to be used for signature. |
588594
| `method` | JSON RPC method name in `String`. Currently, the request method only supports the singing methods. |
589595
| `requestParams` | Parameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at [RPC methods](<[https://docs.metamask.io/wallet/reference/json-rpc-api/](https://docs.metamask.io/wallet/reference/json-rpc-api/)>) to know more. |
590596

@@ -594,19 +600,28 @@ that the request method currently supports only the signing methods.
594600
595601
try {
596602
List<dynamic> params = [];
603+
// Message to be signed
597604
params.add("Hello, Web3Auth from Flutter!");
605+
// User's EOA address
598606
params.add("<User Address in Hex>");
599607
608+
// highlight-start
600609
await Web3AuthFlutter.request(
610+
ChainConfig(
611+
chainId: "0x1",
612+
rpcTarget: "https://mainnet.infura.io/v3/$key",
613+
),
601614
"personal_sign",
602615
params,
603616
);
617+
// highlight-end
604618
} on UserCancelledException {
605619
log("User cancelled.");
606620
} catch(e) {
607621
log("Unknown exception occurred");
608622
}
609623
624+
// highlight-next-line
610625
final signResponse = await Web3AuthFlutter.getSignResponse();
611626
log(signResponse.toString())
612627
```

docs/sdk/pnp/ios/usage.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ valid JWT token in `W3ALoginParams` as well.
397397

398398
```swift title="Usage"
399399
do {
400-
let loginParams = W3ALoginParams(loginProvider: .GOOGLE)
401-
let isMFAEnabled = try await self.web3Auth.enableMFA(loginParams)
400+
// highlight-next-line
401+
let isMFAEnabled = try await self.web3Auth.enableMFA()
402402
} catch {
403403
print(error.localizedDescription)
404404
// Handle Error
@@ -469,14 +469,18 @@ public struct ChainConfig: Codable {
469469
</TabItem>
470470
</Tabs>
471471

472+
### Usage
473+
472474
```swift title="Usage"
473475
do {
476+
// highlight-start
474477
try await web3Auth!.launchWalletServices(
475478
chainConfig: ChainConfig(
476479
chainId: "11155111",
477480
rpcTarget: "https://eth-sepolia.public.blastapi.io"
478481
)
479482
)
483+
// highlight-end
480484
} catch {
481485
print(error.localizedDescription)
482486
// Handle error
@@ -510,12 +514,18 @@ do {
510514
// User's EOA address
511515
params.append(address)
512516

517+
// highlight-start
513518
try await self.web3Auth?.request(
514-
loginParams,
519+
chainConfig: ChainConfig(
520+
chainId: "11155111",
521+
rpcTarget: "https://eth-sepolia.public.blastapi.io"
522+
),
515523
method: "personal_sign",
516524
requestParams: params
517525
)
526+
// highlight-end
518527

528+
// highlight-next-line
519529
let response = try Web3Auth.getSignResponse()
520530

521531
if response!.success {

src/common/guides/_flutter-installation.mdx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,6 @@ whitelisting you scheme and package name.
5555

5656
<TabItem value="ios">
5757

58-
#### Add dependencies
59-
60-
In order to build iOS for Web3Auth project, we also need to add the Web3Auth SDK in iOS. You can
61-
either add it using Swift Package Manager or Cocoapods.
62-
63-
##### Swift Package Manager
64-
65-
<SPM />
66-
67-
##### Cocoapods
68-
69-
<Cocoapods />
70-
7158
#### Configuration
7259

7360
<IOSWhitelist />

src/common/sdk/pnp/flutter/_installation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Add `web3auth_flutter` as a dependency to your `pubspec.yaml`.
55

66
```yaml
77
dependencies:
8-
web3auth_flutter: ^3.1.7
8+
web3auth_flutter: ^4.0.0
99
```
1010
1111
Add `web3auth_flutter` using `flutter pub add command`.

0 commit comments

Comments
 (0)