Skip to content

Commit

Permalink
Merge branch 'main' into adding-base-sepolia-support-for-wagmi-permis…
Browse files Browse the repository at this point in the history
…sion-tests
  • Loading branch information
KannuSingh committed Sep 20, 2024
2 parents 5800cc0 + 48ad644 commit b65aa8f
Show file tree
Hide file tree
Showing 60 changed files with 1,097 additions and 657 deletions.
38 changes: 38 additions & 0 deletions .changeset/nasty-rats-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-wallet': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@apps/laboratory': patch
'@examples/html-ethers': patch
'@examples/html-ethers5': patch
'@examples/html-wagmi': patch
'@examples/next-ethers': patch
'@examples/next-wagmi': patch
'@examples/react-ethers': patch
'@examples/react-ethers5': patch
'@examples/react-solana': patch
'@examples/react-wagmi': patch
'@examples/vue-ethers5': patch
'@examples/vue-solana': patch
'@examples/vue-wagmi': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-ethers': patch
'@reown/appkit-ethers5': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-solana': patch
'@reown/appkit-ui': patch
'@reown/appkit-wagmi': patch
---

Fixes issue where wagmi would not reconnect on an active session
38 changes: 38 additions & 0 deletions .changeset/sharp-wombats-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit': patch
'@reown/appkit-wallet': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@apps/laboratory': patch
'@examples/html-ethers': patch
'@examples/html-ethers5': patch
'@examples/html-wagmi': patch
'@examples/next-ethers': patch
'@examples/next-wagmi': patch
'@examples/react-ethers': patch
'@examples/react-ethers5': patch
'@examples/react-solana': patch
'@examples/react-wagmi': patch
'@examples/vue-ethers5': patch
'@examples/vue-solana': patch
'@examples/vue-wagmi': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-ethers': patch
'@reown/appkit-ethers5': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-solana': patch
'@reown/appkit-ui': patch
'@reown/appkit-wagmi': patch
---

Refactors solana network and account syncing logic to clean up the code and fix missing project id for solana connection
38 changes: 38 additions & 0 deletions .changeset/small-parents-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-wallet': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@apps/laboratory': patch
'@examples/html-ethers': patch
'@examples/html-ethers5': patch
'@examples/html-wagmi': patch
'@examples/next-ethers': patch
'@examples/next-wagmi': patch
'@examples/react-ethers': patch
'@examples/react-ethers5': patch
'@examples/react-solana': patch
'@examples/react-wagmi': patch
'@examples/vue-ethers5': patch
'@examples/vue-solana': patch
'@examples/vue-wagmi': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-ethers': patch
'@reown/appkit-ethers5': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-solana': patch
'@reown/appkit-ui': patch
'@reown/appkit-wagmi': patch
---

Add Solana CoinbaseWalletProvider to allow connecting with coinbase extension
38 changes: 38 additions & 0 deletions .changeset/two-cats-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
'@reown/appkit-adapter-wagmi': patch
'@apps/laboratory': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@examples/html-ethers': patch
'@examples/html-ethers5': patch
'@examples/html-wagmi': patch
'@examples/next-ethers': patch
'@examples/next-wagmi': patch
'@examples/react-ethers': patch
'@examples/react-ethers5': patch
'@examples/react-solana': patch
'@examples/react-wagmi': patch
'@examples/vue-ethers5': patch
'@examples/vue-solana': patch
'@examples/vue-wagmi': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-common': patch
'@reown/appkit-ethers': patch
'@reown/appkit-ethers5': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-solana': patch
'@reown/appkit-ui': patch
'@reown/appkit-wagmi': patch
'@reown/appkit-wallet': patch
---

Fixes wrong wagmi authConnector name causing issues when merging multiple authConnectors
38 changes: 38 additions & 0 deletions .changeset/wise-bobcats-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-utils': patch
'@reown/appkit': patch
'@reown/appkit-common': patch
'@reown/appkit-wallet': patch
'@reown/appkit-core': patch
'@apps/demo': patch
'@apps/gallery': patch
'@apps/laboratory': patch
'@examples/html-ethers': patch
'@examples/html-ethers5': patch
'@examples/html-wagmi': patch
'@examples/next-ethers': patch
'@examples/next-wagmi': patch
'@examples/react-ethers': patch
'@examples/react-ethers5': patch
'@examples/react-solana': patch
'@examples/react-wagmi': patch
'@examples/vue-ethers5': patch
'@examples/vue-solana': patch
'@examples/vue-wagmi': patch
'@reown/appkit-adapter-polkadot': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-cdn': patch
'@reown/appkit-ethers': patch
'@reown/appkit-ethers5': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-solana': patch
'@reown/appkit-ui': patch
'@reown/appkit-wagmi': patch
---

Updates the localstorage keys
1 change: 0 additions & 1 deletion apps/laboratory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"@tanstack/react-query": "5.24.8",
"@wagmi/connectors": "5.1.9",
"@wagmi/core": "2.13.4",
"@walletconnect/ethereum-provider": "2.16.1",
"@walletconnect/universal-provider": "2.16.1",
"@walletconnect/utils": "2.16.1",
"@reown/appkit": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useAppKitProvider,
type Provider
} from '@reown/appkit/react'
import { EthereumProvider } from '@walletconnect/ethereum-provider'
import { UniversalProvider } from '@walletconnect/universal-provider'
import { useChakraToast } from '../Toast'
import { ethers } from 'ethers5'
import { W3mFrameProvider } from '@reown/appkit-wallet'
Expand Down Expand Up @@ -59,9 +59,9 @@ export function Ethers5GetCallsStatusTest() {
if (walletProvider instanceof W3mFrameProvider) {
return true
}
if (walletProvider instanceof EthereumProvider) {
if (walletProvider instanceof UniversalProvider) {
return Boolean(
walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes(
walletProvider?.session?.namespaces?.['eip155']?.methods?.includes(
EIP_5792_RPC_METHODS.WALLET_GET_CALLS_STATUS
)
)
Expand Down
6 changes: 3 additions & 3 deletions apps/laboratory/src/components/Ethers/Ethers5ModalInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react'
import EthereumProvider from '@walletconnect/ethereum-provider'
import UniversalProvider from '@walletconnect/universal-provider'

import { AppKitInfo } from '../AppKitInfo'

Expand All @@ -10,11 +10,11 @@ export function Ethers5ModalInfo() {

const { chainId } = useAppKitNetwork()
const { isConnected, address } = useAppKitAccount()
const { walletProvider, walletProviderType } = useAppKitProvider<EthereumProvider>('eip155')
const { walletProvider, walletProviderType } = useAppKitProvider<UniversalProvider>('eip155')

async function getClientId() {
if (walletProviderType === 'walletConnect') {
return await walletProvider?.signer?.client?.core?.crypto?.getClientId()
return await walletProvider?.client?.core?.crypto?.getClientId()
}

return undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Stack, Text, Spacer, Heading } from '@chakra-ui/react'
import { useState, useEffect } from 'react'
import { useAppKitAccount, useAppKitProvider, useAppKitNetwork } from '@reown/appkit/react'
import { EthereumProvider } from '@walletconnect/ethereum-provider'
import { UniversalProvider } from '@walletconnect/universal-provider'
import { useChakraToast } from '../Toast'
import type { Address } from 'viem'
import type { Provider as RawProvider } from '@reown/appkit'
Expand All @@ -14,7 +14,7 @@ import {
} from '../../utils/EIP5792Utils'
import { W3mFrameProvider } from '@reown/appkit-wallet'

type Provider = W3mFrameProvider | Awaited<ReturnType<(typeof EthereumProvider)['init']>>
type Provider = W3mFrameProvider | Awaited<ReturnType<(typeof UniversalProvider)['init']>>

export function Ethers5SendCallsTest() {
const [loading, setLoading] = useState(false)
Expand Down Expand Up @@ -102,9 +102,9 @@ export function Ethers5SendCallsTest() {
if (walletProvider instanceof W3mFrameProvider) {
return true
}
if (walletProvider instanceof EthereumProvider) {
if (walletProvider instanceof UniversalProvider) {
return Boolean(
walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes(
walletProvider?.session?.namespaces?.['eip155']?.methods?.includes(
EIP_5792_RPC_METHODS.WALLET_SEND_CALLS
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useAppKitProvider,
type Provider
} from '@reown/appkit/react'
import { EthereumProvider } from '@walletconnect/ethereum-provider'
import { UniversalProvider } from '@walletconnect/universal-provider'
import { useChakraToast } from '../Toast'
import { parseGwei } from 'viem'
import { vitalikEthAddress } from '../../utils/DataUtil'
Expand Down Expand Up @@ -34,7 +34,7 @@ export function Ethers5SendCallsWithPaymasterServiceTest() {
useEffect(() => {
if (
address &&
(walletProvider instanceof EthereumProvider || walletProvider instanceof W3mFrameProvider)
(walletProvider instanceof UniversalProvider || walletProvider instanceof W3mFrameProvider)
) {
getCapabilitySupportedChainInfo(
WALLET_CAPABILITIES.PAYMASTER_SERVICE,
Expand Down Expand Up @@ -111,9 +111,9 @@ export function Ethers5SendCallsWithPaymasterServiceTest() {

function isSendCallsSupported(): boolean {
// We are currently checking capabilities above. We should use those capabilities instead of this check.
if (walletProvider instanceof EthereumProvider) {
if (walletProvider instanceof UniversalProvider) {
return Boolean(
walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes(
walletProvider?.session?.namespaces['eip155']?.methods?.includes(
EIP_5792_RPC_METHODS.WALLET_SEND_CALLS
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useAppKitProvider,
type Provider
} from '@reown/appkit/react'
import { EthereumProvider } from '@walletconnect/ethereum-provider'
import { UniversalProvider } from '@walletconnect/universal-provider'
import { useChakraToast } from '../Toast'
import { BrowserProvider } from 'ethers'
import { W3mFrameProvider } from '@reown/appkit-wallet'
Expand Down Expand Up @@ -58,9 +58,9 @@ export function EthersGetCallsStatusTest() {
if (walletProvider instanceof W3mFrameProvider) {
return true
}
if (walletProvider instanceof EthereumProvider) {
if (walletProvider instanceof UniversalProvider) {
return Boolean(
walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes(
walletProvider?.session?.namespaces?.['eip155']?.methods?.includes(
EIP_5792_RPC_METHODS.WALLET_GET_CALLS_STATUS
)
)
Expand Down
6 changes: 3 additions & 3 deletions apps/laboratory/src/components/Ethers/EthersModalInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react'
import EthereumProvider from '@walletconnect/ethereum-provider'
import UniversalProvider from '@walletconnect/universal-provider'

import { AppKitInfo } from '../AppKitInfo'

Expand All @@ -9,11 +9,11 @@ export function EthersModalInfo() {
const [clientId, setClientId] = React.useState<string | undefined>(undefined)
const { isConnected, address } = useAppKitAccount()
const { chainId } = useAppKitNetwork()
const { walletProvider, walletProviderType } = useAppKitProvider<EthereumProvider>('eip155')
const { walletProvider, walletProviderType } = useAppKitProvider<UniversalProvider>('eip155')

async function getClientId() {
if (walletProviderType === 'walletConnect') {
return await walletProvider?.signer?.client?.core?.crypto?.getClientId()
return await walletProvider?.client?.core?.crypto?.getClientId()
}

return undefined
Expand Down
11 changes: 5 additions & 6 deletions apps/laboratory/src/components/Ethers/EthersSendCallsTest.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, Stack, Text, Spacer, Heading } from '@chakra-ui/react'
import { useState, useEffect } from 'react'
import { useAppKitAccount, useAppKitNetwork, useAppKitProvider } from '@reown/appkit/react'
import { EthereumProvider } from '@walletconnect/ethereum-provider'
import { UniversalProvider } from '@walletconnect/universal-provider'
import { useChakraToast } from '../Toast'
import type { Address } from 'viem'
import { vitalikEthAddress } from '../../utils/DataUtil'
Expand All @@ -12,8 +12,7 @@ import {
getCapabilitySupportedChainInfo
} from '../../utils/EIP5792Utils'
import { W3mFrameProvider } from '@reown/appkit-wallet'

type Provider = W3mFrameProvider | Awaited<ReturnType<(typeof EthereumProvider)['init']>>
type Provider = W3mFrameProvider | Awaited<ReturnType<(typeof UniversalProvider)['init']>>

export function EthersSendCallsTest() {
const [loading, setLoading] = useState(false)
Expand All @@ -33,7 +32,7 @@ export function EthersSendCallsTest() {
if (address && walletProvider) {
getCapabilitySupportedChainInfo(
WALLET_CAPABILITIES.ATOMIC_BATCH,
walletProvider as Provider,
walletProvider as unknown as Provider,
address
).then(capabilities => setAtomicBatchSupportedChains(capabilities))
} else {
Expand Down Expand Up @@ -100,9 +99,9 @@ export function EthersSendCallsTest() {
if (walletProvider instanceof W3mFrameProvider) {
return true
}
if (walletProvider instanceof EthereumProvider) {
if (walletProvider instanceof UniversalProvider) {
return Boolean(
walletProvider?.signer?.session?.namespaces?.['eip155']?.methods?.includes(
walletProvider?.session?.namespaces?.['eip155']?.methods?.includes(
EIP_5792_RPC_METHODS.WALLET_SEND_CALLS
)
)
Expand Down
Loading

0 comments on commit b65aa8f

Please sign in to comment.