Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
### Making Blockchain Calls
### Make blockchain calls

While using the Web3Auth Flutter SDK, you get the private key within the user scope. This private key can interact with [Ethereum](https://ethereum.org/) to make any blockchain calls, like getting user's `account`, fetch `balance`, `sign transaction`, `send transaction`, `read` from and `write` to the smart contract, etc.
After the user signs in, the SDK provides a user-scoped private key.

:::info Connect any Blockchain
Use the private key to interact with chains such as [Ethereum](https://ethereum.org/) to make
blockchain calls, like fetching a user's account balance, signing or sending
transactions, and reading or writing to smart contracts.

Refer to the [Blockchain Documentation](/connect-blockchain/) to know more about how to make calls on any blockchain.
:::info Connect any blockchain

Refer to the [blockchain documentation](/embedded-wallets/connect-blockchain/) to learn more about
making calls on any supported blockchain.

:::
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
### MetaMask Embedded Wallets Flutter Quick Start
### MetaMask Embedded Wallets Flutter quickstart

This guide is designed to help you quickly integrate a basic instance of MetaMask Embedded Wallet SDKs in your Flutter app.
This guide is designed to help you quickly integrate a basic instance of MetaMask Embedded wallets
(Web3Auth) SDKs in your Flutter app.

If you face any problem anytime, you can always find help in the [Web3Auth Community](https://web3auth.io/community/c/help-pnp/pnp-flutter/18).
Build the project locally:

:::tip building locally

- Clone the MetaMask Embedded Wallets Flutter Quick Start Application
1. Clone the MetaMask Embedded Wallets Flutter quickstart application:

```shell npm2yarn
npx degit Web3Auth/web3auth-flutter-examples/flutter-quick-start flutter-quick-start
```

- Install & Run
1. Change to the quickstart directory, then install and run the application:

```shell npm2yarn
cd flutter-quick-start
### run project in Android Studio or in VSCode
```

:::
If you need help, visit the [Web3Auth community](https://web3auth.io/community/c/help-pnp/pnp-flutter/18).
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
### Create and initialize the Web3Auth instance
### Initialize the `Web3Auth` instance

Let's now create an instance of the `Web3AuthFlutter`.
You'll need a `clientId` and `network` to initialize the `Web3AuthFlutter` class.

We need `clientId` and `network` to initialize Web3AuthFlutter class. You can get your `clientId` from registering (above), whereas `network` signifies the type of network(`sapphire_mainnet` or `sapphire_devnet`) you want to initialize web3auth with.
You can get your `clientId` from the previous step, whereas `network` signifies the type of
network(`SAPPHIRE_MAINNET` or `SAPPHIRE_DEVNET`) you want to initialize `Web3Auth` with.

:::info sdk reference
:::info SDK reference

Read more about [Flutter SDK](/embedded-wallets/sdk/flutter).
Read more about the [Flutter SDK](/embedded-wallets/sdk/flutter).

:::
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Install MetaMask Embedded Wallet SDK
### Install the MetaMask Embedded Wallets SDK

For making hybrid iOS & Android applications using Flutter, we have the [web3auth-flutter-sdk](https://github.com/Web3Auth/web3auth-flutter-sdk) to integrate MetaMask Embedded Wallets into your application.
Use the [Web3Auth Flutter SDK](https://github.com/Web3Auth/web3auth-flutter-sdk) to integrate MetaMask
Embedded Wallets into your application.

Add `web3auth_flutter` as a dependency to your `pubspec.yaml` file.

Expand All @@ -15,8 +16,9 @@ dependencies:
web3auth_flutter: ^3.1.1 ### or the latest version
```

:::warning Update to the Latest-SDK
:::warning Update to the latest SDK

Please use the **[latest version](https://github.com/Web3Auth/web3auth-flutter-sdk/releases)** of MetaMask's Web3Auth Flutter SDK.
Use the latest version of the Web3Auth Flutter SDK (for MetaMask Embedded Wallets).
See the [release notes](https://github.com/Web3Auth/web3auth-flutter-sdk/releases).

:::
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
### Logging in your User
### Sign in your user

Use the `login` function in the Web3Auth Instance to log in user. Just create a button that triggers the `login` for the user of the login method of their choice.
Use the `Web3Auth` instance [`login`](/embedded-wallets/sdk/flutter/usage#logging-in-a-user)
function to sign in the user. You can create a button that triggers the `login` function for the
sign in method of their choice.

After a successful user login, Web3Auth will redirect back to your app, with a payload stored in the state of the Web3Auth Instance.

:::info SDK Reference

- [`login()` function](/embedded-wallets/sdk/flutter/usage#logging-in-a-user).

:::
After a successful sign-in, the SDK stores the session state internally, and the user is redirected
back to your app.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
### Log the user out
### Sign out the user

Use the `logout` function of the Web3Auth Instance to log the user out.

:::info SDK Reference

- [`logout()` function](/embedded-wallets/sdk/flutter/usage#logging-out-a-user).

:::
Use the [`logout`](/embedded-wallets/sdk/flutter/usage#logging-out-a-user) function of the Web3Auth
instance to sign the user out.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
:::note Requirements Android
### Android prerequisites

- Android API version `24` or newer is required.
- `compileSdk` should be `34` or newer.
- Check `android/app/build.gradle` in your Flutter project to change it.
- Android API version `24` or later
- `compileSdk` version `34` or later

:::
Refer to the `android/app/build.gradle` file in your Flutter project to update the versions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
:::note Requirements iOS
### iOS prerequisites

- iOS 14+
- Xcode 11.4+ / 12.x
- Swift 4.x / 5.x
- `platform :ios` needs to be `14.0`.
- Check `ios/Podfile` in your Flutter project to change it.
- iOS 14 or later
- Xcode 12 or later
- Swift 5 or later
- `platform :ios` version 14.0

:::
Refer to the `ios/Podfile` file in your Flutter project to update the versions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
### Whitelist Package & Bundle ID
### Whitelist your bundle ID

To whitelist, you'll need to create a project or use an existing one in the [Developer Dashboard](https://dashboard.web3auth.io).
To whitelist your app:

- Create or Select a Web3Auth project.
1. In the [Web3Auth dashboard](https://dashboard.web3auth.io), select your project.

- To **Whitelist URLs** section:
- Add `{SCHEME}://{YOUR_APP_PACKAGE_NAME}` for `Android`,
- and, `{bundleId}://auth` for `iOS` to
1. Select the **Domains** tab. In **Whitelist URLs**, add:

- `<bundleId>://auth` for iOS.
- `{SCHEME}://{YOUR_APP_PACKAGE_NAME}` for Android.
Loading