CKB Pulse

All lessons · CCC (TypeScript SDK) · Start here · Glossary

Headless EIP-6963 test wallet for driving the CCC connector in PlaywrightWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

To drive CCC's real EIP-6963 connector and EVM/Omnilock signing in headless Playwright, inject a minimal EIP-1193 provider with page.addInitScript passed as a string, because transpiled function sources carry helpers such as __name that the page lacks. The provider answers eth_requestAccounts, eth_accounts and personal_sign, stubs on and removeListener, and announces itself on eip6963:announceProvider, also whenever eip6963:requestProvider fires. Signing runs in Node through page.exposeFunction so the key never enters the page, and personal_sign must return r‖s‖v with v = 27 + recovery id; noble-curves 2.x sign with format "recovered" yields recovery‖r‖s, so reorder it with hexFrom(bytesConcat(recovered.slice(1, 65), [recovered[0] + 27])) and check it against ccc.verifyMessageEvmPersonal.

Why it matters: With noble's recovery‖r‖s layout passed through unchanged, the signature is not in the r‖s‖v form personal_sign is expected to return, so the commit checks its signer against ccc.verifyMessageEvmPersonal.

Pattern

Prefer
return hexFrom(bytesConcat(recovered.slice(1, 65), [recovered[0] + 27]));

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Testing and devnet, Witnesses and signatures
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-22
Last changed
2026-10-22
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about CCC (TypeScript SDK)

All 33 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Headless EIP-6963 test wallet for driving the CCC connector in Playwright", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/headless-eip-6963-test-wallet-for-driving-the-ccc-connector, CC BY 4.0, last changed 2026-10-22.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.