Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/reference/clarinet-js-sdk/browser-sdk-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The browser build of the Clarinet SDK lets you interact with simnet directly fro

{% code title="Install" %}
```bash
npm install @hirosystems/clarinet-sdk-browser
npm install @stacks/clarinet-sdk-browser
```
{% endcode %}

Expand All @@ -18,7 +18,7 @@ The browser SDK implements the same API as the Node.js Clarinet SDK. All methods

{% code title="Empty session (TypeScript)" %}
```ts
import { initSimnet } from '@hirosystems/clarinet-sdk-browser';
import { initSimnet } from '@stacks/clarinet-sdk-browser';

const simnet = await initSimnet();
await simnet.initEmptySession();
Expand All @@ -35,7 +35,7 @@ For testing with an existing Clarinet project using a virtual file system:

{% code title="Using a Clarinet project (TypeScript)" %}
```ts
import { initSimnet } from '@hirosystems/clarinet-sdk-browser';
import { initSimnet } from '@stacks/clarinet-sdk-browser';

const simnet = await initSimnet();
await simnet.initSession("/project", "Clarinet.toml");
Expand All @@ -57,7 +57,7 @@ Using a Clarinet project in the browser requires setting up a virtual file syste

{% code title="Playground example (TypeScript)" %}
```ts
import { initSimnet } from '@hirosystems/clarinet-sdk-browser';
import { initSimnet } from '@stacks/clarinet-sdk-browser';
import { Cl } from '@stacks/transactions';

// Initialize simnet
Expand Down Expand Up @@ -88,7 +88,7 @@ console.log(count.result); // (ok u1)

{% code title="Browser test example (TypeScript + Vitest)" %}
```ts
import { initSimnet } from '@hirosystems/clarinet-sdk-browser';
import { initSimnet } from '@stacks/clarinet-sdk-browser';
import { expect } from 'vitest';

const simnet = await initSimnet();
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/clarinet-js-sdk/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm init -y
Install the Clarinet JS SDK and its dependencies:

```bash
npm install @hirosystems/clarinet-sdk vitest @stacks/transactions
npm install @stacks/clarinet-sdk vitest @stacks/transactions
```

## Project structure
Expand Down Expand Up @@ -101,7 +101,7 @@ Set up Vitest so the SDK can bootstrap the testing environment:

```js
import { defineConfig } from "vitest/config";
import { vitestSetupFilePath } from "@hirosystems/clarinet-sdk/vitest";
import { vitestSetupFilePath } from "@stacks/clarinet-sdk/vitest";

export default defineConfig({
test: {
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/clarinet-js-sdk/sdk-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Clarinet JS SDK provides a comprehensive suite of helpers for testing and in
## Installation

```bash
npm install @hirosystems/clarinet-sdk
npm install @stacks/clarinet-sdk
```

## Initialize simulated network
Expand All @@ -29,7 +29,7 @@ initSimnet(manifestPath?: string): Promise<Simnet>
```

```ts
import { initSimnet } from '@hirosystems/clarinet-sdk';
import { initSimnet } from '@stacks/clarinet-sdk';

const simnet = await initSimnet();
```
Expand Down Expand Up @@ -321,7 +321,7 @@ mineBlock(txs: Tx[]): ParsedTransactionResult[]
```

```ts
import { tx } from '@hirosystems/clarinet-sdk';
import { tx } from '@stacks/clarinet-sdk';
import { Cl } from '@stacks/transactions';

const block = simnet.mineBlock([
Expand Down
42 changes: 12 additions & 30 deletions docs/reference/clarinet/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ description = "A counter smart contract"

[contracts.traits]
path = "contracts/traits.clar"
clarity_version = 3
clarity_version = 4
epoch = "latest"

[contracts.counter]
path = "contracts/counter.clar"
clarity_version = 3
clarity_version = 4
epoch = "latest"
```

Expand Down Expand Up @@ -97,19 +97,19 @@ The **package.json** defines your testing environment and dependencies:
"author": "",
"license": "ISC",
"dependencies": {
"@hirosystems/clarinet-sdk": "^3.0.2",
"@stacks/transactions": "^7.0.6",
"@types/node": "^24.0.14",
"@stacks/clarinet-sdk": "^3.9.1",
"@stacks/transactions": "^7.2.0",
"@types/node": "^24.4.0",
"chokidar-cli": "^3.0.0",
"vitest": "^3.1.3",
"vitest-environment-clarinet": "^2.3.0"
"vitest": "^4.0.7",
"vitest-environment-clarinet": "^3.0.0"
}
}
```

| Package | Purpose |
| ----------------------------- | ------------------------------------------------------- |
| `@hirosystems/clarinet-sdk` | WebAssembly-compiled Clarinet for Node.js |
| `@stacks/clarinet-sdk` | WebAssembly-compiled Clarinet for Node.js |
| `@stacks/transactions` | Clarity value manipulation in TypeScript |
| `vitest` | Modern testing framework with native TypeScript support |
| `vitest-environment-clarinet` | Simnet bootstrapping for tests |
Expand All @@ -119,9 +119,11 @@ The **package.json** defines your testing environment and dependencies:
The **vitest.config.js** configures the testing framework:

```js

/// <reference types="vitest" />

import { defineConfig } from "vite";
import { vitestSetupFilePath, getClarinetVitestsArgv } from "@hirosystems/clarinet-sdk/vitest";
import { vitestSetupFilePath, getClarinetVitestsArgv } from "@stacks/clarinet-sdk/vitest";

export default defineConfig({
test: {
Expand Down Expand Up @@ -178,7 +180,7 @@ The **tsconfig.json** provides TypeScript support:
"noFallthroughCasesInSwitch": true
},
"include": [
"node_modules/@hirosystems/clarinet-sdk/vitest-helpers/src",
"node_modules/@stacks/clarinet-sdk/vitest-helpers/src",
"tests"
]
}
Expand Down Expand Up @@ -236,23 +238,3 @@ If you're encountering import errors in your tests, update your TypeScript confi
This configuration ensures TypeScript understands Vite's module resolution strategy and allows importing `.ts` files directly.

</details>

<details>

<summary>Mismatched versions</summary>

All contracts in your project should use the same Clarity version and epoch to avoid compatibility issues:

```toml
[contracts.token]
clarity_version = 3
epoch = "latest"

[contracts.pool]
clarity_version = 3
epoch = "latest"
```

Mismatched versions can cause deployment failures and unexpected behavior. Always upgrade all contracts together when moving to a new Clarity version.

</details>
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading