Install latest LTS version of node (at the time of writing, version is v16.16.0)
Run npm install
in this directory.
In your own code please run npm install starknet@next
for the latest version of starknet.js.
The Account contract used in this workshop is made by OpenZeppelin: contract version 0.5.1
Argent accounts example: For an example on how to do this with Argent's account, take a look at this tutorial.
The compilation of Account.json was done by using Nile and these instructions.
Class hash was obtained with the Starkli tool.
High level explanations from StarkWare:
NOTE: this demo was done and tested with the local devnet, which we recommend to do also.
- Install the devnet following the official documentation
- Go to the devnet repo and start:
starknet-devnet --seed 0
->--seed 0
ensures the creation of same predeployed accounts each time
node precalculate_address.js
node deploy_account.js
NOTE: if you start like this, the workshop will run on the goerli testnet.
To start with the local devnet:
Go to the workshop repo and start like this:
STARKNET_PROVIDER_BASE_URL=http://127.0.0.1:5050/ node deploy_account.js
NOTE: tested on devnet only
STARKNET_PROVIDER_BASE_URL=http://127.0.0.1:5050/ node deploy_erc20.js
This workshop, along with general info about starknet.js, is shown in videos below:
Note: these videos are outdated with regards to code, but still are nice introduction to Starknet.js
Ask in #starknet-js channel in the StarkNet Discord
DMs - 0xSean#1534 on Discord