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 1
1
{
2
2
"name" : " @thirdweb-dev/wagmi-adapter" ,
3
- "version" : " 0.0.1 " ,
3
+ "version" : " 0.1.0 " ,
4
4
"repository" : {
5
5
"type" : " git" ,
6
6
"url" : " git+https://github.com/thirdweb-dev/js.git#main"
23
23
},
24
24
"./package.json" : " ./package.json"
25
25
},
26
- "files" : [" dist/*" , " src/*" ],
26
+ "files" : [
27
+ " dist/*" ,
28
+ " src/*"
29
+ ],
27
30
"devDependencies" : {
28
31
"@wagmi/core" : " 2.16.0" ,
29
32
"rimraf" : " 6.0.1" ,
You can’t perform that action at this time.
0 commit comments