CKB Pulse

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

Split CCC signTransaction from sendTransaction to retry on consumed inputsWorkingFrom one fix

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

When several clients race to spend the same shared cell, sign with signer.signTransaction and send with signer.client.sendTransaction as two steps instead of signer.sendTransaction. The dead-input rejection only appears at broadcast, so wrapping just the send in the retry catch lets you tell contention (re-read the live cell, rebuild, sign again) from a wallet refusal or a script verification failure, which must not be retried. Cap the attempts, because each retry costs another signature.

Why it matters: With a single sign-and-send call, a lost race for the shared cell cannot be cleanly separated from a wallet refusal. The retry loop then cannot rebuild against the new live cell.

Pattern

Prefer
return await signer.client.sendTransaction(signedTx);

Taken from the commit, shortened.

Concepts
Transaction building and fees, Network and RPC reliability
Evidence
From one fix: from one project, checked against its commit
First seen
2026-09-23
Last changed
2026-09-23
Last checked
2026-11-19
Check against the commit
partly right: a true core, with a part that is loose or too wide

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, "Split CCC signTransaction from sendTransaction to retry on consumed inputs", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/split-ccc-signtransaction-from-sendtransaction-to-retry-on-c, CC BY 4.0, last changed 2026-09-23.

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.