https://github.com/nethermindeth/starknet.go
Golang Library for StarkNet/Cairo
https://github.com/nethermindeth/starknet.go
blockchain go golang nubia starknet
Last synced: 2 months ago
JSON representation
Golang Library for StarkNet/Cairo
- Host: GitHub
- URL: https://github.com/nethermindeth/starknet.go
- Owner: NethermindEth
- License: mit
- Created: 2022-01-03T22:48:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-01-30T20:33:56.000Z (3 months ago)
- Last Synced: 2026-01-31T10:25:58.543Z (3 months ago)
- Topics: blockchain, go, golang, nubia, starknet
- Language: Go
- Homepage: https://starknet-go.nethermind.io/
- Size: 18 MB
- Stars: 177
- Watchers: 12
- Forks: 140
- Open Issues: 35
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: docs/CODEOWNERS
Awesome Lists containing this project
README
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/invoke) to add a new invoke transaction on testnet.
- [declare transaction example](./examples/simpleDeclare) to add a new contract on testnet.
- [deploy contract UDC example](./examples/deployContractUDC) to deploy an ERC20 token using [UDC (Universal Deployer Contract)](https://docs.openzeppelin.com/contracts-cairo/1.0.0/udc) on testnet.
- [paymaster example](./examples/paymaster) to learn how to interact with a paymaster and send transactions with it.
- [typed data example](./examples/typedData) to sign and verify a typed data.
- [websocket example](./examples/websocket) to learn how to subscribe to WebSocket methods.
Check [here](https://github.com/NethermindEth/starknet.go/tree/main/examples) for some FAQ.
### RPC
`starknet.go` RPC implements the Starknet [RPC v0.9.0 spec](https://github.com/starkware-libs/starknet-specs/releases/tag/v0.9.0)
| 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: |
| `starknet_getStorageProof` | :heavy_check_mark: |
| `starknet_getMessagesStatus` | :heavy_check_mark: |
| `starknet_getCompiledCasm` | :heavy_check_mark: |
#### WebSocket Methods
| Method | Implemented (*) |
| ------------------------------------------ | ------------------ |
| `starknet_subscribeEvents` | :heavy_check_mark: |
| `starknet_subscribeNewHeads` | :heavy_check_mark: |
| `starknet_subscribeNewTransactions` | :heavy_check_mark: |
| `starknet_subscribeNewTransactionReceipts` | :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=.
```
## 📖 License
This project is licensed under the **MIT license**.
See [LICENSE](LICENSE) for more information.
Happy coding! 🎉
## Contributors ✨
Thanks goes to these wonderful people