全部经验 · CCC (TypeScript SDK) · 从这里开始 · 术语表
Headless EIP-6963 test wallet for driving the CCC connector in Playwright实践来自一次修复
来自一次修复 · 核对结果:正确 · 核对于 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.
为什么重要: 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.
代码模式
return hexFrom(bytesConcat(recovered.slice(1, 65), [recovered[0] + 27]));摘自提交,已缩短。
同一提交中改动了测试
它与修复在一起,我们没有运行它。
- salmansarwarr/Tranfr:
demo/e2e/lifecycle.spec.ts,demo/e2e/test-wallet.ts
- 概念
- Testing and devnet, Witnesses and signatures
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-10-22
- 最近改动
- 2026-10-22
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(1)
- 2026-10-22 · salmansarwarr/Tranfr · 这个项目的更多经验
更多关于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
引用这条经验
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.