Skip to content

Commit

Permalink
Merge branch 'fix/fetch-native-balance-on-testnet' of github.com:reow…
Browse files Browse the repository at this point in the history
…n-com/appkit into fix/fetch-native-balance-on-testnet
  • Loading branch information
tomiir committed Jan 21, 2025
2 parents ed80306 + 817021e commit 52aa9f5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
23 changes: 23 additions & 0 deletions .changeset/shy-lamps-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-adapter-bitcoin': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit': patch
'@reown/appkit-utils': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': patch
'@reown/appkit-common': patch
'@reown/appkit-core': patch
'@reown/appkit-experimental': patch
'@reown/appkit-polyfills': patch
'@reown/appkit-scaffold-ui': patch
'@reown/appkit-siwe': patch
'@reown/appkit-siwx': patch
'@reown/appkit-ui': patch
'@reown/appkit-wallet': patch
'@reown/appkit-wallet-button': patch
---

Fixed an issue where wagmi connectors were not appearing in the connect modal
16 changes: 8 additions & 8 deletions packages/adapters/wagmi/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,6 @@ export class WagmiAdapter extends AdapterBlueprint {
}

public async syncConnectors(options: AppKitOptions, appKit: AppKit) {
// Add wagmi connectors
this.addWagmiConnectors(options, appKit)

// Add current wagmi connectors to chain adapter blueprint
await Promise.all(
this.wagmiConfig.connectors.map(connector => this.addWagmiConnector(connector, options))
)

/*
* Watch for new connectors. This is needed because some EIP6963
* connectors are added later in the process the initial setup
Expand All @@ -458,6 +450,14 @@ export class WagmiAdapter extends AdapterBlueprint {
onChange: connectors =>
connectors.forEach(connector => this.addWagmiConnector(connector, options))
})

// Add wagmi connectors
this.addWagmiConnectors(options, appKit)

// Add current wagmi connectors to chain adapter blueprint
await Promise.all(
this.wagmiConfig.connectors.map(connector => this.addWagmiConnector(connector, options))
)
}

public async syncConnection(
Expand Down
2 changes: 2 additions & 0 deletions packages/adapters/wagmi/src/tests/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ describe('WagmiAdapter', () => {

it('should set wagmi connectors', async () => {
vi.spyOn(wagmiCore, 'watchConnectors').mockImplementation(vi.fn())
vi.spyOn(wagmiCore, 'watchConnectors')

await adapter.syncConnectors(
{ networks: [mainnet], projectId: 'YOUR_PROJECT_ID' },
mockAppKit
)

expect(wagmiCore.watchConnectors).toHaveBeenCalledOnce()
expect(adapter.connectors).toStrictEqual([
{
chain: 'eip155',
Expand Down

0 comments on commit 52aa9f5

Please sign in to comment.