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
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.
- salmansarwarr/Tranfr:
demo/e2e/lifecycle.spec.ts,demo/e2e/test-wallet.ts
- 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)
- 2026-10-22 · salmansarwarr/Tranfr · more from this project
More about CCC (TypeScript SDK)
- Re-zero the witness lock before recomputing the sign message with getSignHashInfo
- CCC custom client scripts must include AnyoneCanPay for SignerCkbPrivateKey
- Hand-rolled Script hash: hash_type byte mapping and molecule offsets, checked against CCC
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.