Skip to content

prajwal27/starknet.dart

 
 

Repository files navigation

starknet.dart

The goal of this SDK is to be able to interact with StarkNet smart contracts in a type-safe way.

You can also call the JSON-RPC endpoint exposed by the StarkNet full nodes (see the specs).

📚 docs

💬 telegram chat

Motivation

StarkNet is a revolution in the web3 world: it allows to scale Ethereum and offers the best possible UX thanks to unique features like account abstraction or session keys.

But web3 mainstream adoption won't happen unless decentralized applications go to mobile.

That's why it's a priority to build the best possible Starknet SDK for dart applications, thus unlocking the era of Flutter mobile apps on StarkNet.

Roadmap

You can follow the progress of the project directly on the kanban.

Contributing

If you want to contribute to this project or have any suggestion, please check out our Contributor Guide.

Dev Guide

Initial Setup

  1. Install python deps. Make sure to select the python interpreter from the local .venv created by poetry if you're using VS Code.
poetry install
  1. Run devnet in one terminal
poetry run devnet start
  1. Setup devnet by deploying contracts
poetry run devnet setup

You can also deploy contracts one by one:

poetry run deploy balance
  1. Interact with deployed contracts:
poetry run interact get_balance
poetry run interact increase_balance 10

Run Tests

You can run the tests with the following command:

dart test

To run the tests on devnet use the following command:

NETWORK=devnet dart test --exclude-tags nodevnet,blockId

Release a new version to pub.dev

You simply need to create a PR where you:

  1. Bump the package version
  2. Add an entry to the CHANGELOG

Make sure it passes all the CI tests, then merge it to release a new version of the package.

Generate freezed model classes

To avoid writing too much boilerplate, we use the freezed library to automatically generate serializer logic.

You can run the following command to generate those classes:

dart run build_runner build

Alternatively, you can hit Cmd + Shift + B in vscode.

Generate docs

To generate docs, run:

dart doc .

For more advanced features, check out the dartdoc package.

Complie cairo contracts

protostar build

You can see compiled contracts in the contracts/build folder.

About

Dart SDK for StarkNet ✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 77.1%
  • Python 22.8%
  • Cairo 0.1%