
Research
/Security News
Laravel Lang Compromised with RCE Backdoor Across 700+ Versions
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.
@stacks/clarinet-sdk
Advanced tools
The Clarinet SDK allows to interact with the simnet in Node.js.
If you want to use the Clarinet SDK in web browsers, try @stacks/clarinet-sdk-browser.
Find the API references of the SDK in our documentation.
You can use this SDK to:
pnpm install @stacks/clarinet-sdk
import { initSimnet } from "@stacks/clarinet-sdk";
import { Cl } from "@stacks/transactions";
async function main() {
const simnet = await initSimnet();
const accounts = simnet.getAccounts();
const address1 = accounts.get("wallet_1");
if (!address1) throw new Error("invalid wallet name.");
const call = simnet.callPublicFn("counter", "add", [Cl.uint(1)], address1);
console.log(Cl.prettyPrint(call.result)); // (ok u1)
const counter = simnet.getDataVar("counter", "counter");
console.log(Cl.prettyPrint(counter)); // 2
}
main();
By default, the SDK will look for a Clarinet.toml file in the current working directory. It's also possible to provide the path to the manifest like so:
const simnet = await initSimnet("./path/to/Clarinet.toml");
The SDK can be used to write unit tests for Clarinet projects.
You'll need to have Node.js (>= 18) and pnpm setup. If you are not sure how to set it up, Volta is a nice tool to get started.
In the terminal, run node --version to make sure it's available and up to date.
Open your terminal and go to a new or existing Clarinet project:
cd my-project
ls # you should see Clarinet.toml and package.json in the list
Install the dependencies and run the test
pnpm install
pnpm test
Visit the clarity starter project to see the testing framework in action.
We recommend to use TypeScript to write the unit tests, but it's also possible to do it with JavaScript. To do so, rename your test files to .test.js instead of .test.ts. You can also delete the tsconfig.json and uninstall typescript with pnpm uninstall typescript.
Note: If you want to write your test in JavaScript but still have a certain level of type safety and autocompletion, VSCode can help you with that. You can create a basic jsconfig.json file:
{
"compilerOptions": {
"checkJs": true,
"strict": true
},
"include": ["node_modules/@stacks/clarinet-sdk/vitest-helpers/src", "unit-tests"]
}
FAQs
A SDK to interact with Clarity Smart Contracts in node.js
The npm package @stacks/clarinet-sdk receives a total of 1,835 weekly downloads. As such, @stacks/clarinet-sdk popularity was classified as popular.
We found that @stacks/clarinet-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Laravel Lang packages were compromised with an RCE backdoor across hundreds of versions, exposing cloud, CI/CD, and developer secrets.

Security News
Socket found a malicious postinstall hook across 700+ GitHub repos, including PHP packages on Packagist and Node.js project repositories.

Security News
Vibe coding at scale is reshaping how packages are created, contributed, and selected across the software supply chain