File tree Expand file tree Collapse file tree 3 files changed +63
-58
lines changed Expand file tree Collapse file tree 3 files changed +63
-58
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # @thirdweb-dev/wagmi-adapter
2+
3+ ## 0.1.0
4+
5+ ### Minor Changes
6+
7+ - [ #5644 ] ( https://github.com/thirdweb-dev/js/pull/5644 ) [ ` 8d2e2ad ` ] ( https://github.com/thirdweb-dev/js/commit/8d2e2ad92db675315f6950b787fd6a5f426e249e ) Thanks [ @joaquim-verges ] ( https://github.com/joaquim-verges ) ! - Wagmi connector for in-app wallets
8+
9+ You can now connect to an in-app wallet in your wagmi applications.
10+
11+ Install the wagmi adapter:
12+
13+ ``` bash
14+ npm install @thirdweb-dev/wagmi-adapter
15+ ```
16+
17+ Create a wagmi config with the in-app wallet connector:
18+
19+ ``` ts
20+ import { http , createConfig } from " wagmi" ;
21+ import { inAppWalletConnector } from " @thirdweb-dev/wagmi-adapter" ;
22+ import { createThirdwebClient , defineChain as thirdwebChain } from " thirdweb" ;
23+
24+ const client = createThirdwebClient ({
25+ clientId: " ..." ,
26+ });
27+
28+ export const config = createConfig ({
29+ chains: [sepolia ],
30+ connectors: [
31+ inAppWalletConnector ({
32+ client ,
33+ // optional: turn on smart accounts
34+ smartAccounts: {
35+ sponsorGas: true ,
36+ chain: thirdwebChain (sepolia ),
37+ },
38+ }),
39+ ],
40+ transports: {
41+ [sepolia .id ]: http (),
42+ },
43+ });
44+ ```
45+
46+ Then in your app, you can use the connector to connect with any supported strategy:
47+
48+ ``` ts
49+ const { connect, connectors } = useConnect ();
50+
51+ const onClick = () => {
52+ const inAppWallet = connectors .find ((x ) => x .id === " in-app-wallet" );
53+ connect ({
54+ connector: inAppWallet ,
55+ strategy: " google" ,
56+ });
57+ };
58+ ```
Original file line number Diff line number Diff line change 11{
22 "name" : " @thirdweb-dev/wagmi-adapter" ,
3- "version" : " 0.0.1 " ,
3+ "version" : " 0.1.0 " ,
44 "repository" : {
55 "type" : " git" ,
66 "url" : " git+https://github.com/thirdweb-dev/js.git#main"
2323 },
2424 "./package.json" : " ./package.json"
2525 },
26- "files" : [" dist/*" , " src/*" ],
26+ "files" : [
27+ " dist/*" ,
28+ " src/*"
29+ ],
2730 "devDependencies" : {
2831 "@wagmi/core" : " 2.16.0" ,
2932 "rimraf" : " 6.0.1" ,
You can’t perform that action at this time.
0 commit comments