
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@hirosystems/clarinet-sdk-browser
Advanced tools
A SDK to interact with Clarity Smart Contracts in the browser
The Clarinet SDK can be used to interact with the simnet from web browsers.
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:
npm install @hirosystems/clarinet-sdk-browser
import { initSimnet } from "@hirosystems/clarinet-sdk-browser";
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 clarinet-sdk requires a few steps to be built and tested locally. We'll look into simplifying this workflow in a future version.
Clone the clarinet repo and cd
into it:
git clone git@github.com:hirosystems/clarinet.git
cd clarinet
Open the SDK workspace in VSCode, it's especially useful to get rust-analyzer to consider the right files with the right cargo features.
code components/clarinet-sdk/clarinet-sdk.code-workspace
The SDK mainly relies on two components:
components/clarinet-sdk-wasm
components/clarinet-sdk
To work with these two packages locally, the first one needs to be built with wasm-pack and linked with: npm link.
Install wasm-pack and run:
cd components/clarinet-sdk-wasm
wasm-pack build --release --scope hirosystems --out-dir pkg-node --target nodejs
cd pkg-node
npm link
FAQs
A SDK to interact with Clarity Smart Contracts in the browser
The npm package @hirosystems/clarinet-sdk-browser receives a total of 15 weekly downloads. As such, @hirosystems/clarinet-sdk-browser popularity was classified as not popular.
We found that @hirosystems/clarinet-sdk-browser 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.