Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE
Need a crash course on Bitcoin layers?
→ READ OUR FREE GUIDE

Try Hiro’s New Cookbook of Code Recipes

Starting a project from scratch is a lot of work—there’s a lot of code that needs writing. Yet many projects need the same code components, so why reinvent the wheel? That’s why we are releasing the Hiro Cookbook, a collection of “recipes” that feature reusable code snippets for all kinds of basic functions. All you have to do is copy, paste, and customize as needed.

Type
Announcement
Topic(s)
Docs
Published
January 23, 2025
Author(s)
Developer Advocate
A graphic showing 2 code recipes
Contents

One of the core principles of Web3 is composability: the idea that you can take code from other projects and build off them to create something new. That code snippets were like lego bricks and could be combined and rearranged into new forms.

That sounds great as an idea, but finding helpful snippets of code in a smart contact 1,000 lines long isn’t easy. And there’s often no clear signal that a given contract has the code you’re looking for anyway.

Finding helpful snippets of code in a smart contact 1,000 lines long isn’t easy.

It would be much easier to make code composable if there was a helpful library of code snippets available to you. One that enables you to find the specific code you need, and one in which the snippets are annotated in ways that make them easy to understand.

That’s what we shipped today.

Meet the Hiro Cookbook

We’ve rolled out a brand new section in Hiro documentation called the Hiro Cookbook that is home to over a dozen “recipes”. Each recipe is a code snippet that handles some specific function, and each recipe has written annotations, so you know exactly how the code in that snippet works, and what parameters you can customize.

For this week’s launch, we’ve published 22 recipes across a wide range of use cases, ranging from generating a random number in Clarity to creating a sponsored transaction using Stacks.js.

Copy the code for any recipe and insert it directly into your application.

We spend a lot of time listening to and answering “how do I do <code-rich-text>x<code-rich-text>?” questions from our developer community. These individual recipes are solutions to some of the most common questions we field from devs, and they span a range of use cases across our tooling and Clarity.

These snippets are a free commodity built by us at Hiro. You can copy the code and insert it directly into your application, customizing it as needed to meet your needs.

In the coming weeks and months, we will be adding new recipes to the cookbook. If there’s specific functions or capabilities you’d love to see added to Hiro docs, reach out to us in the #hiro-documentation channel under Hiro Developer Tools on Discord.

Product updates & dev resources straight to your inbox
Your Email is in an invalid format
Checkbox is required.
Thanks for
subscribing.
Oops! Something went wrong while submitting the form.
Copy link
Mailbox
Hiro news & product updates straight to your inbox
Only relevant communications. We promise we won’t spam.

Related stories