Giter Club home page Giter Club logo

ccc's Introduction

Logo

CCC

NPM Version GitHub commit activity GitHub last commit GitHub deployments Demo

"CCC - CKBers' Codebase" is the next step of "Common Chains Connector".
Empower yourself with CCC to discover the unlimited potential of CKB.
Interoperate with wallets from different chain ecosystems.
Fully enabling CKB's Turing completeness and cryptographic freedom power.

Preview

This project is still under active development, and we are looking forward to your feedback. Try its demo now here. It showcases how to use CCC for some basic scenarios in CKB.

Transaction Composing

Here's an example for transferring CKB:

const tx = ccc.Transaction.from({
  outputs: [{ lock: toLock, capacity: ccc.fixedPointFrom(amount) }],
});

Tell CCC what you need, and then...

await tx.completeInputsByCapacity(signer);
await tx.completeFeeBy(signer, 1000); // Transaction fee rate
const txHash = await signer.sendTransaction(tx);

We have done everything! Check the demo source code for complete examples.

Installing

We design CCC for both front-end and back-end developers. You need only one package to fulfil all your needs:

CCC exports everything on the ccc object:

import { ccc } from "@ckb-ccc/<package-name>";

Build and Run

Run the demo of CCC in two steps:

  1. Install packages and build the project
# Navigate to the project directory and run the following commands to install all necessary packages and build the project:
pnpm install
pnpm build
  1. Run the demo in development mode
# Go to the demo directory and start the development server:
cd packages/demo
pnpm run dev

Who uses CCC?

FAQs

Property '*' does not exist on type 'typeof import("*/@ckb-ccc/connector-react/dist/barrel")'.ts(2339)

CCC uses JS's Package Entry Points feature to help tree shaking while exporting everything on the ccc object. Ensure in your tsconfig.json, moduleResolution is set to node16nodenext, or bundler, and resolvePackageJsonExports is not disabled.

Read the TypeScript's Guide for more.

Can I use Lumos with CCC?

While we recommend using CCC for composing transactions, we also provide Lumos patches to:

  • Support the JoyID Wallet.
  • Support the Nostr Wallet.

See lumos-patches: npm install @ckb-ccc/lumos-patches

You can apply patches by:

import { generateDefaultScriptInfos } from "@ckb-ccc/lumos-patches";

// Before using Lumos. You don't need @ckb-lumos/joyid anymore.
registerCustomLockScriptInfos(generateDefaultScriptInfos());

Links

  • Nervos CKB Docs is the documentation website of Nervos CKB.
  • Lumos and its Docs: Lumos provides utils to help compose CKB transactions.
  • RGB++ SDK and its Design: RGB++ is a protocol for issuing assets with Turing-completed VM on BTC L1.
  • Spore SDK and its Docs: The on-chain digital object (DOBs) protocol designed to empower ownership, distribution, and value capture.

ccc's People

Contributors

hanssen0 avatar spectremercury avatar trongdth avatar sakukuku avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.