JSPM

@celo/contractkit

9.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 31586
  • Score
    100M100P100Q155572F
  • License Apache-2.0

Celo's ContractKit to interact with Celo network

Package Exports

  • @celo/contractkit
  • @celo/contractkit/lib
  • @celo/contractkit/lib/base
  • @celo/contractkit/lib/base.js
  • @celo/contractkit/lib/celo-tokens
  • @celo/contractkit/lib/celo-tokens.js
  • @celo/contractkit/lib/index.js
  • @celo/contractkit/lib/mini-kit
  • @celo/contractkit/lib/mini-kit.js
  • @celo/contractkit/lib/proxy
  • @celo/contractkit/lib/proxy.js
  • @celo/contractkit/lib/wrappers/Attestations
  • @celo/contractkit/lib/wrappers/Attestations.js
  • @celo/contractkit/lib/wrappers/BaseWrapper
  • @celo/contractkit/lib/wrappers/BaseWrapper.js
  • @celo/contractkit/lib/wrappers/Governance
  • @celo/contractkit/lib/wrappers/Governance.js
  • @celo/contractkit/lib/wrappers/ReleaseGold
  • @celo/contractkit/lib/wrappers/ReleaseGold.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@celo/contractkit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ContractKit

Celo's ContractKit is a library to help developers and validators to interact with the Celo blockchain.

ContractKit supports the following functionality:

  • Interact with json RPC API
  • Send Transaction with celo's extra fields: (feeCurrency)
  • Build apps to interact with governance and staking

User Guide

[!TIP] You might not need the ContractKit. For new projects we recommened viem or web3 optionally with our celo plugin.

Getting Started

To install you will need Node.js v18.14.2. or greater. v20 reccomended.

npm install @celo/contractkit
// or
yarn add @celo/contractkit

Examples

To start working with contractkit you need a kit instance:

import { newKit } from '@celo/contractkit' // or import { newKit } from '@celo/contractkit/lib/mini-kit'

const kit = newKit("https://alfajores-forno.celo-testnet.org")

List Registered ValidatorGroups

const validatorsContractWrapper = await kit.contracts.getValidators()
const validatorGroups = await validatorsContractWrapper.getRegisteredValidatorGroups()

Show locked Celo balance for account

const lockedGoldContractWrapper = await kit.contracts.getLockedGold()

const accountAddress = kit.defaultAccount 
const summary = lockedGoldContractWrapper.getAccountSummary(accountAddress!)

More Information

You can find more information about the ContractKit in the Celo docs at https://docs.celo.org/developer-guide/contractkit.

How we work

We are a GitHub-first team, which means we have a strong preference for communicating via GitHub. Please use GitHub to:

🐞 File a bug report

💬 Ask a question

Suggest a feature

🧑‍💻 Contribute!

🚔 Report a security vulnerability

[!TIP]

Please avoid messaging us via Slack, Telegram, or email. We are more likely to respond to you on GitHub than if you message us anywhere else. We actively monitor GitHub, and will get back to you shortly 🌟

Debugging

If you need to debug kit, we use the well known debug node library.

So set the environment variable DEBUG as:

DEBUG="kit:*,