Starknet JS

Starknet.js Overview

Starknet.js (opens in a new tab) is a lightweight JavaScript/TypeScript library enabling interaction between your DApp and Starknet. Starknet.js allows you to interact with Starknet accounts, providers, and contracts.

Installing Starknet.js

Follow the official Starknet.js installation instructions: (opens in a new tab)

Configuring Starknet.js for Madara

Connecting to your running Madara node requires you to point your provider to the Madara RPC URL.

const provider = new starknet.RpcProvider({
  nodeUrl: "http://localhost:9944",

You can now use this provider to interact with the chain as explained in the Starknet.js docs (opens in a new tab).

Karnot (opens in a new tab) has also developed ready-to-use scripts using Starknet.js to fund wallets, declare and deploy contracts and some other useful tasks. You can refer to them here (opens in a new tab).