What is Starknet.js ?
Starknet.js is a library that helps to connect your website or your Decentralized Application (DAPP) to the blockchain-based Starknet network, using JavaScript / TypeScript language.
Overview​
Some important topics that have to be understood:
You can connect your DAPP to several networks:
- Starknet mainnet (Layer 2 of Ethereum network ).
- Starknet testnet (Layer 2 of Goerli network (testnet of Ethereum)).
- Starknet-devnet (your local Starknet network, for developers).
and also to some more specific solutions:
- private customized version of Starknet.
- local Starknet node (connected to mainnet or testnet).
Understand what is Starknet and how it works is necessary. Then, you can learn how to interact with it using Starknet.js. So, at this stage, you should be aware of the content of the Starknet official doc and the Starknet Book.
- Only the
Provider
object is talking directly to the network - your DAPP will talk mainly toAccount
andContract
objects. You will define with theProvider
with which network you want to work. You can ask the Provider for some low-level data of the network (block, timestamp, ...). Signer
andUtils
objects contain many useful functions for interaction with Starknet.js.- The
Contract
object is mainly used to read the memory of a blockchain contract. - The
Account
object is the most useful:- as a wallet, to store your tokens.
- as a way to pay the fees to the network, and to be able to write in its memory.