The Clarinet JS SDK is a JavaScript library used to write unit tests for Clarity smart contracts.
The Clarinet JS SDK allows you to write unit tests for your Clarity smart contracts. You can theoretically use any JavaScript test framework, but the SDK supports Vitest out of the box. This SDK leverages simnet, a simulated network that offers a rapid feedback loop for initial testing.
Here is a non-exhaustive list of some of simnet's use-cases:
Call public and read-only functions from smart contracts
Get Clarity maps or data-var values
Get contract interfaces (available functions and data)
Write unit tests for Clarity smart contracts
Requirements
The SDK requires Node.js >= 18.0 and NPM to be installed.
Clarinet: Build your app in a local environment on Stacks.
Stacks.js: Don’t reinvent the wheel and build faster with a JS library that handles basic blockchain functionality.
Stacks Blockchain API: Fetch data and broadcast transactions with the Stacks Blockchain API.
Need help building with Clarinet JS SDK?
Reach out to us on the #clarinet channel on Discord under the Hiro Developer Tools section. There's also a weekly office hours on Discord every Thursday at 11am ET.