Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nethermindeth/starknet.go

Golang Library for StarkNet/Cairo
https://github.com/nethermindeth/starknet.go

nubia

Last synced: 4 days ago
JSON representation

Golang Library for StarkNet/Cairo

Awesome Lists containing this project

README

        








Go Reference





test











Get the gopher Starkpilled






**starknet.go** will get your golang backends and WASM frontends to Starknet easily.
With simple abstractions for the Starknet RPC, account management and common
operations on the wallets. The package has excellent documentation for a smooth
0 to 1 experience.

# 🌟 Features

- Seamless interaction with the Starknet RPC
- Tight integration with Juno
- Account management: Deploy accounts easily
- Good concurrency support

# Getting Started

- library documentation available at [pkg.go.dev](https://pkg.go.dev/github.com/NethermindEth/starknet.go).
- [simple call example](./examples/simpleCall) to make a contract call to a testnet contract.
- [deploy account example](./examples/deployAccount) to deploy a new account contract on testnet.
- [invoke transaction example](./examples/simpleInvoke) to add a new invoke transaction on testnet.
- [deploy contract UDC example](./examples/deployContractUDC) to deploy an ERC20 token using [UDC (Universal Deployer Contract)](https://docs.starknet.io/architecture-and-concepts/accounts/universal-deployer/) on testnet.
- [typed data example](./examples/typedData) to sign and verify a typed data.

### Run Examples

***starknet simpleCall***

```sh
cd examples/simpleCall
go run main.go
```
> Check [here](examples/simpleCall/README.md) for more details

***starknet deployAccount***

```sh
cd examples/deployAccount
go run main.go
```

> Check [here](examples/deployAccount/README.md) for more details

***starknet invokeTransaction***

```sh
cd examples/simpleInvoke
go run main.go
```

> Check [here](examples/simpleInvoke/README.md) for more details

***starknet deployContractUDC***

```sh
cd examples/deployContractUDC
go run main.go
```

> Check [here](examples/deployContractUDC/README.md) for more details.


Check [here](https://github.com/NethermindEth/starknet.go/tree/main/examples) for some FAQ answered by these examples.

### RPC

`starknet.go` RPC implements the Starknet [RPC v0.7.1 spec](https://github.com/starkware-libs/starknet-specs/tree/v0.7.1)

| Method | Implemented (*) |
| ------------------------------------------ | ------------------ |
| `starknet_getBlockWithReceipts` | :heavy_check_mark: |
| `starknet_getBlockWithTxHashes` | :heavy_check_mark: |
| `starknet_getBlockWithTxs` | :heavy_check_mark: |
| `starknet_getStateUpdate` | :heavy_check_mark: |
| `starknet_getStorageAt` | :heavy_check_mark: |
| `starknet_getTransactionByHash` | :heavy_check_mark: |
| `starknet_getTransactionByBlockIdAndIndex` | :heavy_check_mark: |
| `starknet_getTransactionReceipt` | :heavy_check_mark: |
| `starknet_getTransactionStatus` | :heavy_check_mark: |
| `starknet_getClass` | :heavy_check_mark: |
| `starknet_getClassHashAt` | :heavy_check_mark: |
| `starknet_getClassAt` | :heavy_check_mark: |
| `starknet_getBlockTransactionCount` | :heavy_check_mark: |
| `starknet_call` | :heavy_check_mark: |
| `starknet_estimateFee` | :heavy_check_mark: |
| `starknet_estimateMessageFee` | :heavy_check_mark: |
| `starknet_blockNumber` | :heavy_check_mark: |
| `starknet_blockHashAndNumber` | :heavy_check_mark: |
| `starknet_chainId` | :heavy_check_mark: |
| `starknet_syncing` | :heavy_check_mark: |
| `starknet_getEvents` | :heavy_check_mark: |
| `starknet_getNonce` | :heavy_check_mark: |
| `starknet_addInvokeTransaction` | :heavy_check_mark: |
| `starknet_addDeclareTransaction` | :heavy_check_mark: |
| `starknet_addDeployAccountTransaction` | :heavy_check_mark: |
| `starknet_traceTransaction` | :heavy_check_mark: |
| `starknet_simulateTransaction` | :heavy_check_mark: |
| `starknet_specVersion` | :heavy_check_mark: |
| `starknet_traceBlockTransactions` | :heavy_check_mark: |

### Run Tests

```go
go test -v ./...
```

### Run RPC Tests

```go
go test -v ./rpc -env [mainnet|devnet|testnet|mock]
```

### Run Benchmarks

```go
go test -bench=.
```

### Compatibility and stability

## 🀝 Contribute

We're always looking for passionate developers to join our community and
contribute to `starknet.go`. Check out our [contributing guide](./docs/CONTRIBUTING.md)
for more information on how to get started.

## πŸ“– License

This project is licensed under the **MIT license**.

See [LICENSE](LICENSE) for more information.

Happy coding! πŸŽ‰
## Contributors ✨

Thanks goes to these wonderful people
([emoji key](https://allcontributors.org/docs/en/emoji-key)):



drspacemn
drspacemn

πŸ’»
Gregory Guillou
Gregory Guillou

πŸ’»
Tarrence van As
Tarrence van As

πŸ’»
Alex Sumner
Alex Sumner

πŸ’»
Yun
Yun

πŸ’»
Zoraiz Mahmood
Zoraiz Mahmood

πŸ’»
Lucas @ StarkWare
Lucas @ StarkWare

πŸ’»


Coburn
Coburn

πŸ’»
Larko
Larko

πŸ’»
oxlime
oxlime

πŸ’»
BlaΕΎ Hrastnik
BlaΕΎ Hrastnik

πŸ’»
Florian
Florian

πŸ’»
greged93
greged93

πŸ’»
Jean-SΓ©bastien Ney
Jean-SΓ©bastien Ney

πŸ’»


Kristijan Rebernisak
Kristijan Rebernisak

πŸ’»
rianhughes
Rian Hughes

πŸ’»
Carmen
Carmen Irene Cabrera RodrΓ­guez

πŸ’»
Josh
Josh Klopfenstein

πŸ’»
Antonio
Antonio Quental

πŸ“–
Jelilat
Jelilat Anofiu

πŸ’»
JorikSchellekens
Jorik Schellekens

πŸ“–


Akashneelesh
Akashneelesh

πŸ’‘
fico
Fico

πŸ’»
Bitcoinnoobie
Bitcoinnoobie

πŸ’»
stranger80
stranger80

πŸ’»
omahs
omahs

πŸ“–

This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!