ckb-ccc-transactions

Installation
SKILL.md

CKB CCC — Transactions

The canonical CCC transaction pattern. This applies to plain CKB transfers and is the foundation that ckb-ccc-udt and ckb-ccc-spore build on top of — those skills only cover what's different for their asset type, not the full pattern again.

You need a connected Signer before any of this — see ckb-ccc-signer-setup.


Standard transaction composition pattern

  1. Resolve recipientconst { script: lock } = await ccc.Address.fromString(toAddress, signer.client).
  2. Build transactionconst tx = ccc.Transaction.from({ outputs: [{ capacity: ccc.fixedPointFrom("100"), lock }] }).
  3. Complete inputsawait tx.completeInputsByCapacity(signer) — must come before fee calculation.
  4. Pay feeawait tx.completeFeeBy(signer) — omit fee rate argument to use automatic network rate.
  5. Sendconst txHash = await signer.sendTransaction(tx).
  6. Verify — Optionally wait for confirmation: await signer.client.waitTransaction(txHash, 1).

This order is mandatory: outputs declared → completeInputsByCapacity → completeFeeBy → sendTransaction. Calling completeFeeBy before completeInputsByCapacity produces an incorrect fee.

Installs
3
Repository
ckb-devrel/ccc
GitHub Stars
41
First Seen
13 days ago
ckb-ccc-transactions — ckb-devrel/ccc