Date

Author

Medha Kothari

DevRel

ContractKit 1.0.0

cLabs releases ContractKit 1.0.0 — a modularized SDK split into 15 packages that makes building on Celo lighter and easier.

celo-becomes-the-first-chain-to-support-local-currency-agentic-payments-with-rip

Reading time

3 minutes

Share

Copy link

The cLabs team is excited to release ContractKit 1.0.0! As explained in our blogpost from the Celo SDK launch last year, ContractKit allows builders to interact with the Celo blockchain and easily integrate Celo Smart Contracts into their applications. This update modularizes ContractKit, allowing developers to only require dependencies they need. We hope that with this update, building on top of Celo will be even easier. You can find the NPM package here, read the release notes here, and check out our docs here for more information.

How do I migrate to this new version?

We wanted to make the transition to 1.0.0 as smooth as possible for developers currently consuming older versions of the ContractKit, so we created this migration guide to help you through it.

What exactly has changed?

  • 15 packages. The main change in this major version is that the original ContractKit package has now been split into 15 different packages: connect, contractKit, explorer, governance, identity, network-utils, transactions-uri, and finally, a bunch of libraries for interacting with different wallets. Find out what each specific package comprises in the migration guide.

ContractKit package structure diagram
  • Web3. The connection package will now handle all communication with Celo nodes, so most prior direct usages of web3.eth within a ContractKit instance is replaced with kit.connection (Note: most of the important web3 functions are implemented in connection, but not all of them). In the future if we want to replace web3, this change makes it very easy to do that.

  • Breaking Changes. Because of the above changes, this new version is not 100% backwards compatible with older versions of the SDK. However, since most of the changes revolve around imports, we don’t anticipate it to be too difficult to transition over. See the previous section for information on how to migrate to 1.0.0, as well as connect with us on Discord if you have further questions!

Why this modularization?

The main benefits to the above changes include:

  • Bundle Size. The ContractKit bundle size is reduced significantly; there is a 28.03% reduction in unpacked size alone. In addition, the large wallet libraries that were initially a part of this package have now been divided into their own self-contained packages. With the new division of packages, developers will now only have to require the wallet they’re going to use, and can ignore all the other ones.

  • Typing. ContractKit is written in Typescript, and its Celo-specific types often led to issues with web3’s typing extension. Now that the connection package defines types that are transformations of the web3 types, we avoid having to overload the web3 typing.

  • Library Updates. We updated our web3 dependency to 1.3.0. In addition, we have made it easier to eventually migrate away from web3, to a lighter version of the library or to other libraries altogether, such as Ethers.js (see a community member’s Ethers.js for Celo implementation here).

Contribute!

We’d like to take this as an opportunity to invite anyone to become a contributor for the ContractKit, and more broadly the Celo ecosystem. This could mean anything, from filing an issue, reviewing pull requests, updating documentation, pushing code, or starting up a conversation on Discord. Let’s work together to create a more inclusive developer ecosystem on Celo.

Connect with the Celo Developer Community on Twitter (@CeloDevs, @CeloOrg), join discussions on Discord, and find more information about Celo here.

Thank you Barbara Liau, Josh Crites, & Gaston Ponti for reviewing this blogpost.

Infrastructure

Interoperability

Milestones and Recaps