Skip to content

Commit 3266693

Browse files
authored
fix(id.place,entrykit): pick correct porto chain (#3803)
1 parent 4cbda5e commit 3266693

6 files changed

Lines changed: 27 additions & 12 deletions

File tree

apps/id.place/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@tanstack/react-query": "^5.83.0",
2626
"arktype": "2.0.0-beta.6",
2727
"ox": "^0.8.3",
28-
"porto": "0.0.60",
28+
"porto": "0.0.76",
2929
"react": "^19.1.0",
3030
"react-dom": "^19.1.0",
3131
"react-router": "^7.6.3",

apps/id.place/popup/router.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const router = createHashRouter([
2222
// TODO: instead of URL params which could be tampered with or linked to from outside our flow, we should
2323
// store the request somewhere and use the ID to look it up, then we can also store the origin of the message event
2424
// instead of relying on document.referrer (which may be blank for private sessions)
25-
// TODO: add `origin` to `onDialogRequest` callback
2625
const offDialogRequest = onDialogRequest(porto, ({ request }) => {
2726
if (request) {
2827
router.navigate(`/request/${request.method}?${new URLSearchParams({ request: JSON.stringify(request ?? null) })}`, {

apps/id.place/src/popup/mode.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ export function mode(): Mode.Mode {
339339
await wait(1000);
340340
throw new Provider.UnsupportedMethodError();
341341
},
342+
async getAssets(parameters) {
343+
console.log("popup.mode.getAssets", parameters);
344+
await wait(1000);
345+
throw new Provider.UnsupportedMethodError();
346+
},
342347
async getCallsStatus(parameters) {
343348
console.log("popup.mode.getCallsStatus", parameters);
344349
await wait(1000);

packages/entrykit/src/ConnectWallet.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { twMerge } from "tailwind-merge";
55
import { useEffect, useRef } from "react";
66
import { useConnect, useConnectors } from "wagmi";
77
import { IdPlaceConnector, isIdPlaceConnector } from "@latticexyz/id.place/internal";
8+
import { useEntryKitConfig } from "./EntryKitConfigProvider";
89

910
export function ConnectWallet() {
1011
const connectors = useConnectors();
@@ -30,6 +31,7 @@ export function ConnectWallet() {
3031
function AccountButton({ connector }: { connector: IdPlaceConnector }) {
3132
const { setOpen } = useModal();
3233
const { connect, isPending, error } = useConnect();
34+
const { chainId } = useEntryKitConfig();
3335

3436
if (error) {
3537
console.error("connect error", error);
@@ -42,7 +44,16 @@ function AccountButton({ connector }: { connector: IdPlaceConnector }) {
4244
variant="secondary"
4345
className="self-auto flex justify-center"
4446
pending={isPending}
45-
onClick={() => connect({ connector })}
47+
onClick={() =>
48+
connect({
49+
connector,
50+
// need to provide both `chainId` and `capabilities` to the
51+
// Porto connector so a fresh browser instance reusing a synced passkey
52+
// can be bound to the correct chain ID for the account
53+
chainId,
54+
capabilities: {},
55+
})
56+
}
4657
autoFocus
4758
>
4859
Sign in

packages/id.place/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"dependencies": {
3737
"debug": "^4.3.4",
38-
"porto": "0.0.60"
38+
"porto": "0.0.76"
3939
},
4040
"devDependencies": {
4141
"@types/debug": "^4.1.7",

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)