Skip to content

Commit dc05f2e

Browse files
committed
[SDK]Fix: use base autoconnect in wagmi adapter (#6005)
<!-- start pr-codex --> ## PR-Codex overview This PR introduces minor updates to the `@thirdweb-dev/wagmi-adapter` package, enhancing the autoconnection feature to accept URL token parameters and making adjustments to the package's metadata. ### Detailed summary - Added support for URL token parameters in the autoconnection feature within `packages/wagmi-adapter/src/connector.ts`. - Updated the `autoConnect` function call to include `wallets: [wallet]`. - Minor updates to the `package.json` file's metadata and dependencies. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 7d9986f commit dc05f2e

File tree

3 files changed

+61
-57
lines changed

3 files changed

+61
-57
lines changed

.changeset/four-ties-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@thirdweb-dev/wagmi-adapter": minor
3+
---
4+
5+
Accept url token parameters on autoconnection

packages/wagmi-adapter/package.json

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,55 @@
11
{
2-
"name": "@thirdweb-dev/wagmi-adapter",
3-
"version": "0.1.9",
4-
"repository": {
5-
"type": "git",
6-
"url": "git+https://github.com/thirdweb-dev/js.git#main"
7-
},
8-
"license": "Apache-2.0",
9-
"bugs": {
10-
"url": "https://github.com/thirdweb-dev/js/issues"
11-
},
12-
"author": "thirdweb eng <eng@thirdweb.com>",
13-
"type": "module",
14-
"main": "./dist/cjs/exports/thirdweb.js",
15-
"module": "./dist/esm/exports/thirdweb.js",
16-
"types": "./dist/types/exports/thirdweb.d.ts",
17-
"typings": "./dist/types/exports/thirdweb.d.ts",
18-
"exports": {
19-
".": {
20-
"types": "./dist/types/exports/thirdweb.d.ts",
21-
"import": "./dist/esm/exports/thirdweb.js",
22-
"default": "./dist/cjs/exports/thirdweb.js"
23-
},
24-
"./package.json": "./package.json"
25-
},
26-
"files": [
27-
"dist/*",
28-
"src/*"
29-
],
30-
"devDependencies": {
31-
"@wagmi/core": "2.16.0",
32-
"rimraf": "6.0.1",
33-
"thirdweb": "workspace:*"
34-
},
35-
"peerDependencies": {
36-
"@wagmi/core": "^2.16.0",
37-
"thirdweb": "^5",
38-
"typescript": ">=5.0.4"
39-
},
40-
"peerDependenciesMeta": {
41-
"typescript": {
42-
"optional": true
43-
}
44-
},
45-
"scripts": {
46-
"format": "biome format ./src --write",
47-
"lint": "biome check ./src",
48-
"fix": "biome check ./src --fix",
49-
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
50-
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
51-
"build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
52-
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
53-
"clean": "rimraf dist"
54-
},
55-
"engines": {
56-
"node": ">=18"
57-
}
2+
"name": "@thirdweb-dev/wagmi-adapter",
3+
"version": "0.1.9",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/thirdweb-dev/js.git#main"
7+
},
8+
"license": "Apache-2.0",
9+
"bugs": {
10+
"url": "https://github.com/thirdweb-dev/js/issues"
11+
},
12+
"author": "thirdweb eng <eng@thirdweb.com>",
13+
"type": "module",
14+
"main": "./dist/cjs/exports/thirdweb.js",
15+
"module": "./dist/esm/exports/thirdweb.js",
16+
"types": "./dist/types/exports/thirdweb.d.ts",
17+
"typings": "./dist/types/exports/thirdweb.d.ts",
18+
"exports": {
19+
".": {
20+
"types": "./dist/types/exports/thirdweb.d.ts",
21+
"import": "./dist/esm/exports/thirdweb.js",
22+
"default": "./dist/cjs/exports/thirdweb.js"
23+
},
24+
"./package.json": "./package.json"
25+
},
26+
"files": ["dist/*", "src/*"],
27+
"devDependencies": {
28+
"@wagmi/core": "2.16.0",
29+
"rimraf": "6.0.1",
30+
"thirdweb": "workspace:*"
31+
},
32+
"peerDependencies": {
33+
"@wagmi/core": "^2.16.0",
34+
"thirdweb": "^5.85.0",
35+
"typescript": ">=5.0.4"
36+
},
37+
"peerDependenciesMeta": {
38+
"typescript": {
39+
"optional": true
40+
}
41+
},
42+
"scripts": {
43+
"format": "biome format ./src --write",
44+
"lint": "biome check ./src",
45+
"fix": "biome check ./src --fix",
46+
"build": "pnpm clean && pnpm build:cjs && pnpm build:esm && pnpm build:types",
47+
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./dist/cjs --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./dist/cjs/package.json",
48+
"build:esm": "tsc --project ./tsconfig.build.json --module es2020 --outDir ./dist/esm && printf '{\"type\": \"module\",\"sideEffects\":false}' > ./dist/esm/package.json",
49+
"build:types": "tsc --project ./tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
50+
"clean": "rimraf dist"
51+
},
52+
"engines": {
53+
"node": ">=18"
54+
}
5855
}

packages/wagmi-adapter/src/connector.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { type CreateConnectorFn, createConnector } from "@wagmi/core";
22
import type { Prettify } from "@wagmi/core/chains";
33
import { type ThirdwebClient, defineChain, getAddress } from "thirdweb";
4+
import { autoConnect } from "thirdweb/wallets";
45
import {
56
EIP1193,
67
type InAppWalletConnectionOptions,
@@ -136,9 +137,10 @@ export function inAppWalletConnector(
136137
const lastChainId = await config.storage?.getItem("tw.lastChainId");
137138
const chain = defineChain(params?.chainId || lastChainId || 1);
138139
if (!wallet.getAccount()) {
139-
await wallet.autoConnect({
140+
await autoConnect({
140141
client,
141142
chain,
143+
wallets: [wallet],
142144
});
143145
}
144146
return EIP1193.toProvider({

0 commit comments

Comments
 (0)