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

AppKit update: Updating the code references to reown #5

Merged
merged 55 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
989dbd4
updating the React code references to reorg
rohit-710 Sep 9, 2024
e71b0bd
updating a minor inconsistency
rohit-710 Sep 9, 2024
c4abf4e
updating code snippets for React's Hooks section
rohit-710 Sep 9, 2024
2e67dea
updating createWeb3Modal options doc page
rohit-710 Sep 9, 2024
90be6a8
updating custom connectors doc page for react
rohit-710 Sep 9, 2024
4125725
renaming reorg to reown
rohit-710 Sep 10, 2024
f1d0c21
updating the links on resources doc page
rohit-710 Sep 10, 2024
d007e64
updating siwe doc page - partially
rohit-710 Sep 10, 2024
dfc0f23
updating Email & Socials doc page
rohit-710 Sep 10, 2024
748d1cb
updating on-ramp doc page
rohit-710 Sep 10, 2024
d34baf6
update swaps doc page
rohit-710 Sep 10, 2024
7a5bfe4
updating Next installation docs and fixing react installation docs
rohit-710 Sep 10, 2024
f6fe5e1
updating Next hooks doc page
rohit-710 Sep 10, 2024
7c58963
updating Next custom connectors doc page
rohit-710 Sep 10, 2024
87c5659
removing solanaNotFound from react and next docs
rohit-710 Sep 11, 2024
9c018cc
update javascript installation doc
rohit-710 Sep 11, 2024
833a89d
update javascript actions doc
rohit-710 Sep 11, 2024
304d4fd
updating javascript custom connectors doc
rohit-710 Sep 11, 2024
5363e8a
updating references to
rohit-710 Sep 11, 2024
393189b
updating vue installation doc
rohit-710 Sep 11, 2024
460b11f
minor change on vue installation doc
rohit-710 Sep 11, 2024
dd5b4fb
fixing vue installation for solana
rohit-710 Sep 11, 2024
35ab940
fixing vue solana installation
rohit-710 Sep 11, 2024
b2da5b4
update vue composable docs
rohit-710 Sep 11, 2024
37a1f18
updating vue custom connectors doc
rohit-710 Sep 11, 2024
65d7280
update siwe docs
rohit-710 Sep 11, 2024
dacd0b4
update vue siwe docs
rohit-710 Sep 11, 2024
86df024
updating javascript siwe docs
rohit-710 Sep 11, 2024
98532f4
updating next siwe docs
rohit-710 Sep 11, 2024
a2b64e9
revamp react native docs
rtomas Sep 11, 2024
182a3e8
revamp ios appkit reown docs
rtomas Sep 11, 2024
d267056
update appkit ios package
rtomas Sep 11, 2024
122352c
chore: react native package rename
ignaciosantise Sep 11, 2024
ca69b4c
chore: renamed appkit rn components
ignaciosantise Sep 11, 2024
59951dc
chore: renamed email packages in react native
ignaciosantise Sep 11, 2024
8b24927
revamp appkit android docs
rtomas Sep 12, 2024
bdab464
renaming rerock references to reown
rohit-710 Sep 12, 2024
68e02fd
creating doc page for Multichain
rohit-710 Sep 12, 2024
e1762e1
adding multichain to the side bar and Next, Js and vue
rohit-710 Sep 12, 2024
6e706f2
fixing multichain sidebar
rohit-710 Sep 12, 2024
31c9b3f
updating appkit.png
rohit-710 Sep 12, 2024
3a68595
updating lab.web3modal.com to appkit-lab.reown.com
rohit-710 Sep 12, 2024
fc07e00
updating lab.web3modal.com to appkit-lab.reown.com
rohit-710 Sep 12, 2024
9efbe11
Update usage.mdx for better context
rohit-710 Sep 12, 2024
c1e84d0
change import structure for reown
rohit-710 Sep 12, 2024
c7174c4
updating appkit imports
rohit-710 Sep 12, 2024
2b124a3
chore: RN small changes
ignaciosantise Sep 12, 2024
fb084bf
text -> 6963 and WC connectors are on by default
rtomas Sep 12, 2024
012ee6f
chore: changed authConnector for RN
ignaciosantise Sep 12, 2024
933bdd8
replacing createWeb3Modal() with createAppKit()
rohit-710 Sep 13, 2024
c995120
renaming useWeb3ModalProvider and useWeb3ModalAccount
rohit-710 Sep 13, 2024
6f42eee
update remaining references of useWeb3ModalProvider
rohit-710 Sep 13, 2024
cff49a0
rename remaining references of useWeb3Modal
rohit-710 Sep 13, 2024
70e3827
updating http to https
rohit-710 Sep 13, 2024
12ee6d8
Update docs/appkit/ios/core/options.mdx
llbartekll Sep 13, 2024
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
4 changes: 1 addition & 3 deletions docs/advanced/walletconnectmodal/resources.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import PlatformTabItem from '../../components/PlatformTabItem'

Valuable assets for developers and users interested in integrating Web3Wallet into their applications.

<!--Todo: Prettify this section-->

- [Awesome WalletConnect](https://github.com/WalletConnect/awesome-walletconnect) - Community-curated collection of WalletConnect-enabled wallets, libraries, and tools.
- [AppKit Laboratory](https://lab.web3modal.com) - A place to test your wallet integrations against various setups of AppKit.
- [AppKit Laboratory](https://appkit-lab.reown.com/) - A place to test your wallet integrations against various setups of AppKit.
- [Web3Wallet GitHub](https://github.com/WalletConnect/walletconnect-monorepo/tree/v2.0/packages/web3wallet) - Web3Wallet GitHub repository.

## Implementation Examples
Expand Down
22 changes: 11 additions & 11 deletions docs/appkit/android/core/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

### Get selected chain

You can get selected chain by calling the `getSelectedChain()` on the `Web3Modal` object.
You can get selected chain by calling the `getSelectedChain()` on the `AppKit` object.

```kotlin
Web3Modal.getSelectedChain()
AppKit.getSelectedChain()
```

## Web3Modal.ModalDelegate
## AppKit.ModalDelegate

```kotlin
val web3ModalModalDelegate = object : Web3Modal.ModalDelegate {
val appKitModalDelegate = object : AppKit.ModalDelegate {
override fun onSessionApproved(approvedSession: Modal.Model.ApprovedSession) {
// Triggered when receives the session approval from wallet
}
Expand Down Expand Up @@ -60,10 +60,10 @@ val web3ModalModalDelegate = object : Web3Modal.ModalDelegate {
}
```

You have set delegate on Web3Modal to start getting updates from Wallet.
You have set delegate on AppKit to start getting updates from Wallet.

```kotlin
Web3Modal.setDelegate(web3ModalModalDelegate)
AppKit.setDelegate(appKitModalDelegate)
```

## Actions
Expand All @@ -72,7 +72,7 @@ You have set delegate on Web3Modal to start getting updates from Wallet.

```kotlin

Web3Modal.disconnect(
AppKit.disconnect(
onSuccess = {
/* callback that letting you know that you have successfully disconnected */
},
Expand All @@ -90,7 +90,7 @@ val requestParams = Modal.Params.Request(
params = /* Method params */,
)

Web3Modal.request(
AppKit.request(
request = requestParams,
onSuccess = {
/* callback that letting you know that you have successful request */
Expand All @@ -103,16 +103,16 @@ Web3Modal.request(

### Get Active Account

Returns the current active account connected via Web3Modal
Returns the current active account connected via AppKit

```kotlin
Web3Modal.getAccount()
AppKit.getAccount()
```

### Get Connection type

Return information about the type of our connection

```kotlin
Web3Modal.getConnectorType()
AppKit.getConnectorType()
```
72 changes: 36 additions & 36 deletions docs/appkit/android/core/components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import TabItem from '@theme/TabItem'

# Components

You can use predefined Web3ModalComponent and add it in your application. As a view, dialog or modal.
You can use predefined AppKitComponent and add it in your application. As a view, dialog or modal.

```kotlin
import androidx.compose.material.ExperimentalMaterialApi
Expand All @@ -20,7 +20,7 @@ setContent {

ModalBottomSheetLayout(
sheetContent = {
Web3ModalComponent(
AppKitComponent(
shouldOpenChooseNetwork = true | false,
closeModal = { coroutineScope.launch { modalSheetState.hide() }
)
Expand All @@ -44,15 +44,15 @@ You can add ready made button components to your application
<TabItem value="compose" label="Compose">

```kotlin
import com.walletconnect.web3.modal.ui.components.button.Web3Button
import com.walletconnect.web3.modal.ui.components.button.ConnectButtonSize
import com.walletconnect.web3.modal.ui.components.button.AccountButtonType
import com.walletconnect.web3.modal.ui.components.button.rememberWeb3ModalState
import com.reown.appkit.ui.components.button.Web3Button
import com.reown.appkit.ui.components.button.ConnectButtonSize
import com.reown.appkit.ui.components.button.AccountButtonType
import com.reown.appkit.ui.components.button.rememberAppKitState

YourAppScreen(navController: NavController) {
val web3ModalState = rememberWeb3ModalState(navController = navController)
val appKitState = rememberAppKitState(navController = navController)
Web3Button(
state = web3ModalState,
state = appKitState,
accountButtonType = AccountButtonType.NORMAL || AccountButtonType.MIXED,
connectButtonSize = ConnectButtonSize.NORMAL || ConnectButtonSize.SMALL
)
Expand All @@ -72,7 +72,7 @@ YourAppScreen(navController: NavController) {
android:gravity="center"
android:orientation="vertical">

<com.walletconnect.web3.modal.ui.components.button.views.Web3Button
<com.reown.appkit.ui.components.button.views.Web3Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:connect_button_size="NORMAL" || "SMALL"
Expand All @@ -93,12 +93,12 @@ YourAppScreen(navController: NavController) {
<TabItem value="compose" label="Compose">

```kotlin
import com.walletconnect.web3.modal.ui.components.button.NetworkButton
import com.walletconnect.web3.modal.ui.components.button.rememberWeb3ModalState
import com.reown.appkit.ui.components.button.NetworkButton
import com.reown.appkit.ui.components.button.rememberAppKitState

YourAppScreen(navController: NavController) {
val web3ModalState = rememberWeb3ModalState(navController = navController)
NetworkButton(state = web3ModalState)
val appKitState = rememberAppKitState(navController = navController)
NetworkButton(state = appKitState)
}
```

Expand All @@ -114,7 +114,7 @@ YourAppScreen(navController: NavController) {
android:gravity="center"
android:orientation="vertical">

<com.walletconnect.web3.modal.ui.components.button.views.NetworkButton
<com.reown.appkit.ui.components.button.views.NetworkButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
Expand All @@ -133,14 +133,14 @@ YourAppScreen(navController: NavController) {
<TabItem value="compose" label="Compose">

```kotlin
import com.walletconnect.web3.modal.ui.components.button.ConnectButton
import com.walletconnect.web3.modal.ui.components.button.ConnectButtonSize
import com.walletconnect.web3.modal.ui.components.button.rememberWeb3ModalState
import com.reown.appkit.ui.components.button.ConnectButton
import com.reown.appkit.ui.components.button.ConnectButtonSize
import com.reown.appkit.ui.components.button.rememberAppKitState

YourAppScreen(navController: NavController) {
val web3ModalState = rememberWeb3ModalState(navController = navController)
val appKitState = rememberAppKitState(navController = navController)
ConnectButton(
state = web3ModalState,
state = appKitState,
buttonSize = ConnectButtonSize.NORMAL || ConnectButtonSize.SMALL
)
}
Expand All @@ -159,7 +159,7 @@ YourAppScreen(navController: NavController) {
android:gravity="center"
android:orientation="vertical">

<com.walletconnect.web3.modal.ui.components.button.views.ConnectButton
<com.reown.appkit.ui.components.button.views.ConnectButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:connect_button_size="NORMAL" || "SMALL"
Expand All @@ -179,14 +179,14 @@ YourAppScreen(navController: NavController) {
<TabItem value="compose" label="Compose">

```kotlin
import com.walletconnect.web3.modal.ui.components.button.AccountButton
import com.walletconnect.web3.modal.ui.components.button.AccountButtonType
import com.walletconnect.web3.modal.ui.components.button.rememberWeb3ModalState
import com.reown.appkit.ui.components.button.AccountButton
import com.reown.appkit.ui.components.button.AccountButtonType
import com.reown.appkit.ui.components.button.rememberAppKitState

YourAppScreen(navController: NavController) {
val web3ModalState = rememberWeb3ModalState(navController = navController)
val appKitState = rememberAppKitState(navController = navController)
AccountButton(
state = web3ModalState,
state = appKitState,
buttonSize = AccountButtonType.NORMAL || AccountButtonType.MIXED
)
}
Expand All @@ -205,7 +205,7 @@ YourAppScreen(navController: NavController) {
android:gravity="center"
android:orientation="vertical">

<com.walletconnect.web3.modal.ui.components.button.views.AccountButton
<com.reown.appkit.ui.components.button.views.AccountButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:account_button_type="NORMAL" || "MIXED"
Expand All @@ -216,28 +216,28 @@ YourAppScreen(navController: NavController) {
</TabItem>
</Tabs>

### Web3Modal State
### AppKit State

Web3modalState is an object that ensures communication between your application and the state of the Web3Modal.
AppKitState is an object that ensures communication between your application and the state of the AppKit.

#### Create web3ModalState:
#### Create appKitState:

NavController is required to create Web3ModalState
NavController is required to create appKitState

```kotlin
val web3modalState = rememberWeb3ModalState(navController)
val appKitState = rememberAppKitState(navController)
```

#### Web3ModalState methods
#### AppKitState methods

```kotlin
web3ModalState.isOpen
appKitState.isOpen
```

returns `StateFlow<Boolean>` whose value is updated depending on whether the web3modal component is open
returns `StateFlow<Boolean>` whose value is updated depending on whether the appkit component is open

```kotlin
web3modalState.isConnected
appKitState.isConnected
```

returns `StateFlow<Boolean>` whose value depends on the active session in Web3Modal
returns `StateFlow<Boolean>` whose value depends on the active session in AppKit
10 changes: 5 additions & 5 deletions docs/appkit/android/core/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Kotlin implementation of AppKit for Android applications.

Android Core ![Maven Central](https://img.shields.io/maven-central/v/com.walletconnect/android-core)
Android Core ![Maven Central](https://img.shields.io/maven-central/v/com.reown/android-core)

Web3Modal ![Maven Central](https://img.shields.io/maven-central/v/com.walletconnect/web3modal)
AppKit ![Maven Central](https://img.shields.io/maven-central/v/com.reown/appkit)

### Requirements

Expand All @@ -27,7 +27,7 @@ allprojects {
app/build.gradle.kts

```gradle
implementation(platform("com.walletconnect:android-bom:$BOM_VERSION"))
implementation("com.walletconnect:android-core")
implementation("com.walletconnect:web3modal")
implementation(platform("com.reown:android-bom:$BOM_VERSION"))
implementation("com.reown:android-core")
implementation("com.reown:appkit")
```
14 changes: 7 additions & 7 deletions docs/appkit/android/core/one-click-auth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Connecting a wallet, proving control of an address with an off-chain signature,

## Configure your AppKit Client

To integrate SIWE with AppKit, you need to configure your Web3Modal client using `Modal.Model.AuthPayloadParams`, which are required to create a SIWE message for the user to sign:
To integrate SIWE with AppKit, you need to configure your AppKit client using `Modal.Model.AuthPayloadParams`, which are required to create a SIWE message for the user to sign:

```kotlin
Web3Modal.setAuthRequestParams(authPayloadParams)
AppKit.setAuthRequestParams(authPayloadParams)
```

#### Example of AuthRequestParams
Expand All @@ -33,9 +33,9 @@ To integrate SIWE with AppKit, you need to configure your Web3Modal client using
)
```

Configuring your Web3Modal client with Modal.Model.AuthPayloadParams will prioritize authentication requests over regular session proposals. If the wallet supports One-Click Auth, the session will be created and the user will automatically authenticate without needing to send another SIWE request over personal_sign. If the wallet does not support One-Click Auth, it will fall back to the session proposal. In this case, to authenticate the user, AppKit will send another session request to prove address ownership.
Configuring your AppKit client with Modal.Model.AuthPayloadParams will prioritize authentication requests over regular session proposals. If the wallet supports One-Click Auth, the session will be created and the user will automatically authenticate without needing to send another SIWE request over personal_sign. If the wallet does not support One-Click Auth, it will fall back to the session proposal. In this case, to authenticate the user, AppKit will send another session request to prove address ownership.

To check whether the user has signed a SIWE message, check `onSessionAuthenticateResponse` callback from `Web3Modal.ModalDelegate`:
To check whether the user has signed a SIWE message, check `onSessionAuthenticateResponse` callback from `AppKit.ModalDelegate`:

```kotlin
fun onSessionAuthenticateResponse(response: Modal.Model.SessionAuthenticateResponse) {
Expand Down Expand Up @@ -85,15 +85,15 @@ CoreClient.initialize(
...
)

Web3Modal.initialize(Modal.Params.Init(core = CoreClient))
AppKit.initialize(Modal.Params.Init(core = CoreClient))
```

Once link mode is configured, your dApp will connect and send requests to wallets via app links after receiving proof from the wallet that it also supports link mode.

The wallet will also send responses using app links. Your app needs to pass these responses to the Web3Modal client so it can process them.
The wallet will also send responses using app links. Your app needs to pass these responses to the AppKit client so it can process them.

```kotlin
Web3Modal.handleDeepLink(url) { error ->
AppKit.handleDeepLink(url) { error ->
//handle error

}
Expand Down
10 changes: 5 additions & 5 deletions docs/appkit/android/core/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ val recommendedWalletsIds = listOf<String>(

val initParams = Modal.Params.Init(core = CoreClient, recommendedWalletsIds = recommendedWalletsIds)

Web3Modal.initialize(
AppKit.initialize(
init = initParams,
onSuccess = {
// Callback will be called if initialization is successful
Expand All @@ -35,7 +35,7 @@ val excludedWalletIds = listOf<String>(

val initParams = Modal.Params.Init(core = CoreClient, excludedWalletIds = excludedWalletIds)

Web3Modal.initialize(
AppKit.initialize(
init = initParams,
onSuccess = {
// Callback will be called if initialization is successful
Expand Down Expand Up @@ -76,7 +76,7 @@ Coinbase has been added since version 1.2.0
```kotlin
val initParams = Modal.Params.Init(core = CoreClient, coinbaseEnabled = true)

Web3Modal.initialize(
AppKit.initialize(
init = initParams,
onSuccess = {
// Callback will be called if initialization is successful
Expand All @@ -87,12 +87,12 @@ Web3Modal.initialize(
)
```

Coinbase Wallet SDK requires Web3Modal registration in Activity to receive responses from Coinbase wallet
Coinbase Wallet SDK requires AppKit registration in Activity to receive responses from Coinbase wallet

```kotlin
fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Web3Modal.register(this)
AppKit.register(this)
// Your content
}
```
Loading