All lessons · CCC (TypeScript SDK) · Start here · Glossary
Pass a config object, not a URL string, to ccc.ClientPublicTestnetWorkingReproduced
Reproduced · Check: right · Checked 2026-11-19
In @ckb-ccc/core, the ClientPublicTestnet constructor takes an options object, so a custom RPC endpoint must be given as { url: rpcUrl } rather than as a bare string argument. This commit corrects the bare string calls in a deploy script to the object form.
Why it matters: If you pass a bare URL string, the constructor finds no url field, so the client silently falls back to the default public testnet endpoint and the --rpc or CKB_RPC_URL setting is ignored.
Pattern
const client = new ccc.ClientPublicTestnet({ url: options.rpcUrl });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:
reference/since-cmp-ts/since_cmp.test.ts,sdk/tests/scaffold.test.ts
Reproduced by a test
A public test runs what this lesson says on @ckb-ccc/core 1.23.1, with no node. Anyone can run it.
tests/ccc/client-config-object.test.mjs
- Concepts
- Network and RPC reliability
- Evidence
- Reproduced: reproduced by a public test
- First seen
- 2026-10-13
- Last changed
- 2026-10-13
- 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-13 · salmansarwarr/Tranfr · more from this project
More about CCC (TypeScript SDK)
- CCC client cache can keep dropped transactions; check status without cache
- Clamp the node's get_fee_rate_statistics median before using it as a fee rate
- Classifying sendTransaction failures before dropping a pending CKB transaction
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Pass a config object, not a URL string, to ccc.ClientPublicTestnet", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/pass-a-config-object-not-a-url-string-to-ccc-clientpublictes, CC BY 4.0, last changed 2026-10-13.