# New: Auto-adding cycles to IC calls + cost calculation functions in \`ic\` mops package

**URL:** <https://forum.dfinity.org/t/new-auto-adding-cycles-to-ic-calls-cost-calculation-functions-in-ic-mops-package/49118>\
**Category:** Motoko\
**Tags:** cycles\
**Created:** [May 27, 2025, 11:28am UTC](https://forum.dfinity.org/t/new-auto-adding-cycles-to-ic-calls-cost-calculation-functions-in-ic-mops-package/49118 "2025-05-27T11:28:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamirus](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kamirus/32/24780_2.png) [@Kamirus](https://forum.dfinity.org/u/Kamirus)\
**Post date:** [May 27, 2025, 11:28am UTC](https://forum.dfinity.org/t/new-auto-adding-cycles-to-ic-calls-cost-calculation-functions-in-ic-mops-package/49118/1 "2025-05-27T11:28:41Z")

</div>

I’ve added cycle cost calculation and cycle auto-attaching for the IC management canister functions. It’s available in the `ic` mops package version `2.1.0` in the `Call` module [(docs here)](https://mops.one/ic/docs/Call).

For exmple, instead of hardcoded cycle costs:

```motoko
await (with cycles = 230_949_972_000) IC.http_request(args)

```

You can do:

```motoko
import IC "mo:ic/Call";
...
await IC.httpRequest(args)

```

It will calculate the minimum amount of cycles needed for the call and auto-attach them.

Check out all available functions in the docs.  
Cost functions are also exposed, in the [inner `Cost` module](https://mops.one/ic/docs/Call#type.Cost).

`moc` with version at least `0.14.10` is needed!

Thanks to @ZenVoich for your assistance!

* * *

Any feedback is greatly appreciated! Let me know if you have questions or suggestions how to improve or what functionality is missing.
