• Stars
    star
    282
  • Rank 146,549 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Complete Starknet library in Rust™

Logo

starknet-rs

Complete Starknet library in Rust

starknet-version-v0.11.2 jsonrpc-spec-v0.2.1 linting-badge crates-badge

Note that starknet-rs is still experimental. Breaking changes will be made before the first stable release. The library is also NOT audited or reviewed for security at the moment. Use at your own risk.

The underlying cryptography library starknet-crypto does NOT provide constant-time guarantees.

Adding starknet-rs to your project

To use the crate from crates.io, add the following to your Cargo.toml file:

[dependencies]
starknet = "0.3.0"

Note that the crates.io version might be outdated. You may want to use the library directly from GitHub for all the latest features and fixes:

[dependencies]
starknet = { git = "https://github.com/xJonathanLEI/starknet-rs" }

Features

  • Sequencer gateway / feeder gateway client
  • Full node JSON-RPC API client
  • Smart contract deployment
  • Signer for using IAccount account contracts
  • Strongly-typed smart contract binding code generation from ABI

Crates

This workspace contains the following crates:

  • starknet: Re-export of other sub-crates (recommended)
  • starknet-core: Core data structures for interacting with Starknet
  • starknet-providers: Abstraction and implementation of clients for interacting with Starknet nodes and sequencers
  • starknet-contract: Types for deploying and interacting with Starknet smart contracts
  • starknet-crypto: Low-level cryptography utilities for Starknet
  • starknet-signers: Starknet signer implementations
  • starknet-accounts: Types for handling Starknet account abstraction
  • starknet-ff: Starknet field element type
  • starknet-curve: Starknet curve operations
  • starknet-macros: Useful macros for using the starknet crates

WebAssembly

starknet-rs can be used as a WebAssembly module. Check out this example.

Using starknet-rs from C++

starknet-rs can be used as a dynamic or static library from C++. Check out this example.

Performance

Benchmark results for native and WebAssembly targets are available for these crates:

For instructions on running the benchmark yourself, check here.

Example

Examples can be found in the examples folder:

  1. Get the latest block from alpha-goerli testnet

  2. Deploy contract to alpha-goerli testnet via UDC

  3. Mint yourself 1,000 TST tokens on alpha-goerli

    Make sure your account has some L2 Goerli ETH to pay for the transaction fee. You can use this faucet to fund your account.

  4. Declare Cairo 1 contract on alpha-goerli testnet

    Make sure your account has some L2 Goerli ETH to pay for the transaction fee. You can use this faucet to fund your account.

  5. Declare legacy Cairo 0 contract on alpha-goerli testnet

    Make sure your account has some L2 Goerli ETH to pay for the transaction fee. You can use this faucet to fund your account.

  6. Query the latest block number with JSON-RPC

  7. Call a contract view function via sequencer gateway

  8. Deploy an Argent X account to a pre-funded address

  9. Parsing a JSON-RPC request on the server side

License

Licensed under either of

at your option.

More Repositories

1

starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
Rust
162
star
2

oriac

A toy Cairo VM implementation in Rust™
Rust
71
star
3

WeChatAPI

A .NET API for WeChat, written in C#
C#
32
star
4

eosyield

A contract whose owner can temporaily yield control over it until a later time
C++
23
star
5

starkware-crypto-rs

Rust FFI bindings for StarkWare's crypto-cpp library
Rust
15
star
6

pedersen-bench

Benchmarks for Pedersen hash implementations
Rust
12
star
7

stakeforme

An EOS smart contract for solving deadlocked account issue
C++
9
star
8

felt-bench

Performance comparison of various Starknet field element type implementations
Rust
9
star
9

EOSafe

A powerful on-chain smart-contract wallet on the EOSIO platform
WebAssembly
8
star
10

starknet-jsonrpc-codegen

Tool for generating the Starknet JSON-RPC code used in `starknet-rs`
Rust
6
star
11

starknet-bootstrap

Bootstrap a new Starknet network by declaring and deploying commonly used classes and contracts
Rust
6
star
12

EVMDebugger

A GUI debugger for Ethereum Virtual Machine (EVM) assembly in C#
C#
5
star
13

acctexchange

An open-source decentralized exchange for trading EOS accounts
C++
5
star
14

NetworkHandler

A C# class that helps you make HTTP requests with a single line of code.
C#
4
star
15

HKGolden

A UWP App for HKGolden
C#
4
star
16

telegram-session-keeper

A command-line tool for creating and using backup Telegram sessions for access without using phone numbers
Rust
4
star
17

cf-workers-site-template

A CI/CD-optimized Cloudflare Workers template for serving static sites
TypeScript
3
star
18

starknet-l1-contracts

Documentation of all StarkNet smart contracts deployed on layer-1 Ethereum
Solidity
3
star
19

NEOS

An EOS library for .NET written in C#
C#
3
star
20

vpn-to-socks

Turn VPN connections into SOCKS5 proxies for use with browsers, curl commands and more
2
star
21

flashcard-gpt

Intelligent and interactive vocabulary flashcards for any language powered by ChatGPT
Rust
2
star
22

irobot-gateway

Simple HTTP-based gateway server for controlling iRobot devices
TypeScript
2
star
23

eosatm

An EOS contract for safe fund withdrawals with daily limits
C++
1
star
24

CookiesTxtParser

A cookies.txt parser library for .NET Standard
C#
1
star
25

CleanHistoryPlugin

An EOS plugin for cleaning all action history data in history_plugin
C++
1
star
26

cf-pages-cli

A simple command line utility for managing Cloudflare Pages projects
Rust
1
star
27

ark-ff-inverse-issue

For temporarily sharing code snippet
Rust
1
star
28

NetKeystore

A lightweight .NET standard library for interacting with Ethereum keystore files
C#
1
star
29

docker-cairo

Multi-arch Docker images with Cairo binaries
Dockerfile
1
star
30

cloudflare-kv-swap

A command line tool for swapping Cloudflare KV namespaces with freshly created ones, useful for "clearing" test data
TypeScript
1
star
31

Ipset.NET

.NET wrapper library for the Linux utility program ipset
C#
1
star
32

worker-starkliup-install

A simple Cloudflare worker that just serves the starkliup install script
Rust
1
star
33

BloomFilter.NET

Generic .NET bloom filter library with support for custom hashing functions
C#
1
star
34

escl-rs

A Rust library for discovering and using scanners via the eSCL protocol (scanning over network)
Rust
1
star
35

ipgeod

Exposing IP geolocation data from local databases via HTTP
Rust
1
star