Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions e2e/harness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ async function runTwoWallets(opts) {
const active = makeProvider({ chainId: 1, ...(opts.provider ?? {}) });
const other = makeProvider({ chainId: 137, exposeChainId: !!(opts.otherAnnounces) });
globalThis.window.ethereum = active;
// A real extension answers every `eip6963:requestProvider`, so it stays in
// the SDK's announcement list when another wallet announces later.
if (opts.answersRequests) {
dom.window.addEventListener("eip6963:requestProvider", () => announce6963(active));
}
announce6963(active);
const formo = await FormoAnalytics.init("wk_e2e", { tracking: true, flushAt: 1, flushInterval: 10, ...opts.sdk });
await settle();
Expand All @@ -352,6 +357,12 @@ async function runTwoWallets(opts) {
other.rpcCalls.length = 0; // only count what the signature costs
rec("otherDiscovered");

// The app's own event, after the other wallet changed network.
if (opts.trackAfter) {
await formo.track("Swap Completed");
await settle(); rec("trackAfterOther");
}

await other.request({ method: "personal_sign", params: ["0x6869", ADDR_A] });
await settle(); rec("signViaOther");

Expand Down
2 changes: 2 additions & 0 deletions e2e/scenarios.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ export const SCENARIOS = [
expect: { signExplicitAccount: [`signature:requested@137/${B}`, `signature:confirmed@137/${B}`] } },
{ name: "eip1193: a second wallet's signature is NOT labelled with the active wallet's chain (#329)", mode: "twowallets",
expect: { signViaOther: [`signature:requested@0/${A}`, `signature:confirmed@0/${A}`] }, rpcMustNotInclude: ["eth_chainId"] },
{ name: "eip1193: another wallet changing network keeps the active wallet's address on track()", mode: "twowallets", opts: { answersRequests: true, otherAnnounces: true, trackAfter: true },
Comment thread
yosriady marked this conversation as resolved.
expect: { otherDiscovered: [`detect@-/${A}`], trackAfterOther: [`track(Swap Completed)@-/${A}`] } },
{ name: "eip1193: a provider with no chain exposed reports 0, never a guess", mode: "cold",
expect: { accountsChanged: [`connect@0/${A}`], signature: [`signature:requested@0/${A}`, `signature:confirmed@0/${A}`] } },
{ name: "eip1193: a provider whose eth_chainId fails still reports 0", mode: "unknownchain",
Expand Down
2 changes: 1 addition & 1 deletion with-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@angular/forms": "^21.2.24",
"@angular/platform-browser": "^21.2.24",
"@angular/router": "^21.2.24",
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"buffer": "^6.0.3",
"rxjs": "~7.8.2",
"tslib": "^2.8.1",
Expand Down
10 changes: 5 additions & 5 deletions with-angular/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-crossmint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@crossmint/client-sdk-react-ui": "4.5.0",
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"clsx": "^2.1.1",
"next": "^16.3.8",
"react": "^19.2.8",
Expand Down
10 changes: 5 additions & 5 deletions with-crossmint/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-dynamic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@dynamic-labs/ethereum": "^4.94.0",
"@dynamic-labs/sdk-react-core": "^4.94.0",
"@dynamic-labs/wagmi-connector": "^4.94.0",
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"@tanstack/react-query": "^5.102.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
10 changes: 5 additions & 5 deletions with-dynamic/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-farcaster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@farcaster/frame-sdk": "latest",
"@farcaster/miniapp-wagmi-connector": "^2.0.0",
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"@tanstack/react-query": "5.102.3",
"@wagmi/core": "^2.22.1",
"buffer": "^6.0.3",
Expand Down
10 changes: 5 additions & 5 deletions with-farcaster/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "next lint"
},
"dependencies": {
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"@metamask/connect-evm": "~0.9.0",
"@wagmi/core": "^3.6.4",
"@wagmi/connectors": "8.1.0",
Expand Down
10 changes: 5 additions & 5 deletions with-metamask/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-next-app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
"node": ">=20.19.0 <21 || >=22"
},
"dependencies": {
"@formo/analytics": "^1.42.0"
"@formo/analytics": "^1.42.1"
}
}
10 changes: 5 additions & 5 deletions with-next-app-router/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion with-next-page-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "next start"
},
"dependencies": {
"@formo/analytics": "^1.42.0",
"@formo/analytics": "^1.42.1",
"@radix-ui/react-dialog": "^1.1.23",
"@radix-ui/react-dropdown-menu": "^2.1.24",
"@radix-ui/react-icons": "^1.3.2",
Expand Down
Loading
Loading