@hirosystems/clarinet-sdk-browser
TypeScript icon, indicating that this package has built-in type declarations

3.4.0 • Public • Published

Clarinet SDK for the Web

The Clarinet SDK can be used to interact with the simnet from web browsers.

If you want to use the Clarinet SDK in Node.js, try @hirosystems/clarinet-sdk.

Find the API references of the SDK in our documentation.
Learn more about unit testing Clarity smart contracts in this guide.

You can use this SDK to:

  • Interact with a clarinet project as you would with the Clarinet CLI
  • Call public, read-only, and private 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

Installation

npm install @hirosystems/clarinet-sdk-browser

Usage

There are two ways to use the sdk in the browser:

  • With an empty clarinet session:
const simnet = await initSimnet();
await simnet.initEmptySession();
simnet.runSnippet("(+ 1 2)")
  • With a clarinet project (ie: with a Clarinet.toml) 💡 It requires to use a virtual file system. More documentation and examples soon.
const simnet = await initSimnet();
await simnet.initSession("/project", "Clarinet.toml")

/@hirosystems/clarinet-sdk-browser/

    Package Sidebar

    Install

    npm i @hirosystems/clarinet-sdk-browser

    Weekly Downloads

    166

    Version

    3.4.0

    License

    GPL-3.0

    Unpacked Size

    24.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • blockstack-devops
    • zone117x
    • rafaelcr
    • cohars