This library exists to support smart contract developers working on our contracts and tests. It is not intended for dapp usage or third-party integration, and we do not provide support or encourage external adoption.
Not fully supported but some things might work. For Vite (and similar bundlers), use the two helpers from browser-shims/vite:
getNodeShimAliases()aliases Node built-ins (fs,path,crypto,child_process) to browser shims so the bundle compiles.getEnvDefines()injects your env vars into the toolkit'sprocess.envreferences at build time somanager/deployerinitialize correctly.
import { getEnvDefines, getNodeShimAliases } from "starknet-dev-toolkit/browser-shims/vite";
export default defineConfig({
define: getEnvDefines(),
resolve: { alias: getNodeShimAliases() },
// ...
});Map your framework's env var names (e.g. SvelteKit's PUBLIC_*) to the toolkit's RPC_URL, ADDRESS, and PRIVATE_KEY. The config file runs in Node so process.env works there. Vite/SvelteKit loads .env before evaluating the config.
Install from a git tag (no registry):
pnpm add argentlabs/starknet-dev-toolkit.git#vX.Y.Z
- Update
versioninpackage.json. - Build and tag:
pnpm build
git tag vX.Y.Z
git push origin vX.Y.Z
- In the consumer's
package.json, point to your local checkout usingfile:path-to-starknet-devnet-toolkit-folder, for example:
"starknet-dev-toolkit": "file:../dev-toolkit"Then run pnpm install --no-frozen-lockfile.
Do not use pnpm add --link. With link:, pnpm creates a symlink and each project keeps its own node_modules, which causes duplicate module instances (e.g. chai gets loaded twice and plugins like chai-as-promised break). file: goes through pnpm's normal resolution so peer dependencies are deduplicated correctly.
- In this repo, run the watch build:
pnpm build:watch
Changes compile into dist/ within seconds. Source maps are emitted; enable
sourcemaps in your runtime/bundler to debug into the original TypeScript.
file:uses hard links, so edits to existing files indist/are reflected automatically. If you add or delete files, re-runpnpm installin the consumer to pick them up.