๐ Features
April 20, 2026 ยท View on GitHub
Caution
This repository is no longer under maintenance and will be archived soon. Thank you to all contributors and users who supported starknet.go over the years. The codebase remains available in read-only mode for reference purposes.
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.
- simple call example to make a contract call to a testnet contract.
- deploy account example to deploy a new account contract on testnet.
- invoke transaction example to add a new invoke transaction on testnet.
- declare transaction example to add a new contract on testnet.
- deploy contract UDC example to deploy an ERC20 token using UDC (Universal Deployer Contract) on testnet.
- paymaster example to learn how to interact with a paymaster and send transactions with it.
- typed data example to sign and verify a typed data.
- websocket example to learn how to subscribe to WebSocket methods.
Check here for some FAQ.
RPC
starknet.go RPC implements the Starknet RPC v0.9.0 spec
| 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 test -v ./...
Run RPC Tests
go test -v ./rpc -env [mainnet|devnet|testnet|mock]
Run Benchmarks
go test -bench=.
๐ License
This project is licensed under the MIT license.
See LICENSE for more information.
Happy coding! ๐
Contributors โจ
Thanks goes to these wonderful people