Skip to content

Commit c032ff9

Browse files
Merge pull request #530 from reown-com/custom-connectors
feat: support custom wagmi connectors in WagmiAdapter
2 parents 4206cca + 3bd49d8 commit c032ff9

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@reown/appkit-wagmi-react-native': patch
3+
---
4+
5+
feat: support custom wagmi connectors in WagmiAdapter constructor

.changeset/fix-security-vulnerabilities.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/wagmi/src/adapter.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { UniversalConnector } from './connectors/UniversalConnector';
2626
type ConfigParams = Partial<CreateConfigParameters> & {
2727
networks: readonly [Chain, ...Chain[]];
2828
projectId: string;
29-
connectors?: Connector[];
3029
};
3130

3231
export class WagmiAdapter extends EVMAdapter {
@@ -46,11 +45,6 @@ export class WagmiAdapter extends EVMAdapter {
4645
}
4746

4847
private createWagmiInternalConfig(configParams: ConfigParams): Config {
49-
// Connectors are typically added via wagmiConfig.connectors, but here AppKit manages the connection.
50-
// We'll use the `connect` action with our dynamically created connector instance.
51-
// So, the `connectors` array for createConfig can be empty and is added later.
52-
const initialConnectors: (() => Connector)[] = [];
53-
5448
const transportsArr = configParams.networks.map(chain => [
5549
chain.id,
5650
getTransport({ chainId: chain.id, projectId: configParams.projectId })
@@ -59,7 +53,7 @@ export class WagmiAdapter extends EVMAdapter {
5953

6054
return createConfig({
6155
chains: configParams.networks,
62-
connectors: initialConnectors, // Empty, as we connect programmatically
56+
connectors: [...(configParams.connectors ?? [])],
6357
transports,
6458
multiInjectedProviderDiscovery: false
6559
});

0 commit comments

Comments
 (0)