Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Headless EIP-6963 test wallet for driving the CCC connector in PlaywrightPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
return hexFrom(bytesConcat(recovered.slice(1, 65), [recovered[0] + 27]));Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- salmansarwarr/Tranfr:
demo/e2e/lifecycle.spec.ts,demo/e2e/test-wallet.ts
- Conceitos
- Testing and devnet, Witnesses and signatures
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-22
- Última mudança
- 2026-10-22
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-10-22 · salmansarwarr/Tranfr · mais deste projeto
Mais sobre 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
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.