# @dfinity/cmc

> A library for interfacing with the cycle minting canister.

Latest version **10.0.0** (published 2026-09-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dfinity/cmc
pnpm add @dfinity/cmc
yarn add @dfinity/cmc
bun add @dfinity/cmc
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.0.0 |
| Published | 2026-09-22 |
| First published | 2022-09-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 81 |
| Maintainers | dayyildiz, antonioventilii-dfinity, npm-dfinity-org, dfn_wndlng, ielashi, dfn-it-owner |
| Keywords | internet computer, internet-computer, ic, dfinity, cmc, cycle minting canister |

## Links

- npm: https://www.npmjs.com/package/@dfinity/cmc
- Repository: https://github.com/dfinity/icp-js-canisters
- Homepage: https://github.com/dfinity/icp-js-canisters#readme
- Issues: https://github.com/dfinity/icp-js-canisters
- npm.io page: https://npm.io/package/@dfinity/cmc

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 10.0.0 (latest) — 2026-09-22
- 9.1.0-next-2026-04-21.1 (next) — 2026-04-21
- 9.0.0-beta-2025-12-18 (beta) — 2025-12-18
- 9.1.0-next-2026-04-21 — 2026-04-21
- 9.1.0-next-2026-04-20 — 2026-04-20
- 9.1.0-next-2026-02-18 — 2026-02-18
- 9.1.0-next-2026-02-11 — 2026-02-11
- 9.1.0-next-2026-01-16 — 2026-01-16
- 9.1.0-next-2026-01-12 — 2026-01-12
- 9.1.0-next-2026-01-09 — 2026-01-09
- 9.1.0-next-2025-12-30 — 2025-12-30
- 9.1.0-next-2025-12-19 — 2025-12-19
- 9.1.0 — 2025-12-19
- 9.0.0-next-2025-12-18.1 — 2025-12-18
- 9.0.0-next-2025-12-18 — 2025-12-18
- … 974 more at https://npm.io/package/@dfinity/cmc/versions

## README

# cmc-js

A library for interfacing with the cycle minting canister.

[![npm version](https://img.shields.io/npm/v/@dfinity/cmc.svg?logo=npm)](https://www.npmjs.com/package/@dfinity/cmc) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

> [!TIP]
> Still using `@dfinity/cmc`? Upgrade to [`@icp-sdk/canisters/cmc`](https://js.icp.build/canisters/latest/upgrading/v1/)!

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Features](#features)

## Installation

You can use `cmc-js` by installing it in your project.

```bash
npm i @dfinity/cmc
```

The bundle needs peer dependencies, be sure that following resources are available in your project as well.

```bash
npm i @icp-sdk/core @dfinity/utils
```

## Usage

The features are available through the class `CmcCanister`. It has to be instantiated with the canister ID of the cycles minting canister. On `mainnet`, its ID is `rkp4c-7iaaa-aaaaa-aaaca-cai`.

e.g. querying the current Icp to cycles conversion rate.

```ts
import { CmcCanister } from "@dfinity/cmc";
import { createAgent } from "@dfinity/utils";

const agent = await createAgent({
  identity,
  host: HOST,
});

const { getIcpToCyclesConversionRate } = CmcCanister.create({
  agent,
  canisterId: CYCLES_MINTING_CANISTER_ID,
});

const rate = await getIcpToCyclesConversionRate();
```

## Documentation

You can find the API docs [here](https://js.icp.build/canisters/latest/api/cmc/).

---
_Source: https://npm.io/package/@dfinity/cmc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
