Skip to content

Commit 2101e80

Browse files
feat: support custom wagmi connectors in WagmiAdapter constructor
Enables users to pass custom Wagmi connectors when initializing the WagmiAdapter. Removes the redundant connectors override from ConfigParams to use wagmi's native CreateConnectorFn[] type. Users can now provide custom connector factories via the config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4206cca commit 2101e80

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
fix: resolve high-severity security vulnerabilities in transitive dependencies
1414

1515
Patched 9 vulnerable packages via resolutions/overrides:
16+
1617
- h3 1.15.5 (Request Smuggling)
1718
- tar 7.5.6 (Race Condition, Arbitrary File Overwrite)
1819
- node-forge 1.3.2 (ASN.1 vulnerabilities)

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)